ruby-changes:38144
From: akr <ko1@a...>
Date: Sat, 11 Apr 2015 14:04:33 +0900 (JST)
Subject: [ruby-changes:38144] akr:r50225 (trunk): * test/ruby/test_file_exhaustive.rb: Test character device using
akr 2015-04-11 14:04:17 +0900 (Sat, 11 Apr 2015) New Revision: 50225 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50225 Log: * test/ruby/test_file_exhaustive.rb: Test character device using /dev/null. Modified files: trunk/ChangeLog trunk/test/ruby/test_file_exhaustive.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 50224) +++ ChangeLog (revision 50225) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Apr 11 14:03:47 2015 Tanaka Akira <akr@f...> + + * test/ruby/test_file_exhaustive.rb: Test character device using + /dev/null. + Sat Apr 11 10:59:58 2015 Nobuyoshi Nakada <nobu@r...> * lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags): Index: test/ruby/test_file_exhaustive.rb =================================================================== --- test/ruby/test_file_exhaustive.rb (revision 50224) +++ test/ruby/test_file_exhaustive.rb (revision 50225) @@ -24,6 +24,7 @@ class TestFileExhaustive < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L24 @hardlinkfile = make_tmp_filename("hardlinkfile") make_file("foo", @file) make_file("", @zerofile) + @chardev = File::NULL == "/dev/null" ? "/dev/null" : nil @time = Time.now begin File.symlink(@file, @symlinkfile) @@ -186,10 +187,11 @@ class TestFileExhaustive < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L187 assert_file.not_blockdev?(@nofile) end - def test_chardev_p ## xxx + def test_chardev_p assert_file.not_chardev?(@dir) assert_file.not_chardev?(@file) assert_file.not_chardev?(@nofile) + assert_file.chardev?(@chardev) if @chardev end def test_exist_p @@ -1006,7 +1008,7 @@ class TestFileExhaustive < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L1008 socket = make_tmp_filename("s") UNIXServer.open(socket).close end - [@dir, @file, @zerofile, @symlinkfile, @hardlinkfile, fifo, socket].compact.each do |f| + [@dir, @file, @zerofile, @symlinkfile, @hardlinkfile, @chardev, fifo, socket].compact.each do |f| assert_equal(File.atime(f), test(?A, f)) assert_equal(File.ctime(f), test(?C, f)) assert_equal(File.mtime(f), test(?M, f)) @@ -1144,6 +1146,7 @@ class TestFileExhaustive < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L1146 def test_stat_chardev_p ## xxx assert(!(File::Stat.new(@dir).chardev?)) assert(!(File::Stat.new(@file).chardev?)) + assert(File::Stat.new(@chardev).chardev?) if @chardev end def test_stat_readable_p -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/