diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-11 05:04:17 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-11 05:04:17 +0000 |
commit | 7156deb522b3244926a3e60cfdd9700c39d38162 (patch) | |
tree | 331f2240316226baaf31510543ddbf65e1d540b2 | |
parent | 335cd8ab6a8625efff924db52216fb94a3d04a08 (diff) | |
download | ruby-7156deb522b3244926a3e60cfdd9700c39d38162.tar.gz |
* test/ruby/test_file_exhaustive.rb: Test character device using
/dev/null.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 7 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Sat Apr 11 14:03:47 2015 Tanaka Akira <akr@fsij.org> + + * test/ruby/test_file_exhaustive.rb: Test character device using + /dev/null. + Sat Apr 11 10:59:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags): diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index 39765290f6..ae76507cef 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -24,6 +24,7 @@ class TestFileExhaustive < Test::Unit::TestCase @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::TestCase 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::TestCase 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::TestCase 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 |