mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
335cd8ab6a
commit
7156deb522
2 changed files with 10 additions and 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>
|
Sat Apr 11 10:59:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags):
|
* lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags):
|
||||||
|
|
|
@ -24,6 +24,7 @@ class TestFileExhaustive < Test::Unit::TestCase
|
||||||
@hardlinkfile = make_tmp_filename("hardlinkfile")
|
@hardlinkfile = make_tmp_filename("hardlinkfile")
|
||||||
make_file("foo", @file)
|
make_file("foo", @file)
|
||||||
make_file("", @zerofile)
|
make_file("", @zerofile)
|
||||||
|
@chardev = File::NULL == "/dev/null" ? "/dev/null" : nil
|
||||||
@time = Time.now
|
@time = Time.now
|
||||||
begin
|
begin
|
||||||
File.symlink(@file, @symlinkfile)
|
File.symlink(@file, @symlinkfile)
|
||||||
|
@ -186,10 +187,11 @@ class TestFileExhaustive < Test::Unit::TestCase
|
||||||
assert_file.not_blockdev?(@nofile)
|
assert_file.not_blockdev?(@nofile)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_chardev_p ## xxx
|
def test_chardev_p
|
||||||
assert_file.not_chardev?(@dir)
|
assert_file.not_chardev?(@dir)
|
||||||
assert_file.not_chardev?(@file)
|
assert_file.not_chardev?(@file)
|
||||||
assert_file.not_chardev?(@nofile)
|
assert_file.not_chardev?(@nofile)
|
||||||
|
assert_file.chardev?(@chardev) if @chardev
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_exist_p
|
def test_exist_p
|
||||||
|
@ -1006,7 +1008,7 @@ class TestFileExhaustive < Test::Unit::TestCase
|
||||||
socket = make_tmp_filename("s")
|
socket = make_tmp_filename("s")
|
||||||
UNIXServer.open(socket).close
|
UNIXServer.open(socket).close
|
||||||
end
|
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.atime(f), test(?A, f))
|
||||||
assert_equal(File.ctime(f), test(?C, f))
|
assert_equal(File.ctime(f), test(?C, f))
|
||||||
assert_equal(File.mtime(f), test(?M, f))
|
assert_equal(File.mtime(f), test(?M, f))
|
||||||
|
@ -1144,6 +1146,7 @@ class TestFileExhaustive < Test::Unit::TestCase
|
||||||
def test_stat_chardev_p ## xxx
|
def test_stat_chardev_p ## xxx
|
||||||
assert(!(File::Stat.new(@dir).chardev?))
|
assert(!(File::Stat.new(@dir).chardev?))
|
||||||
assert(!(File::Stat.new(@file).chardev?))
|
assert(!(File::Stat.new(@file).chardev?))
|
||||||
|
assert(File::Stat.new(@chardev).chardev?) if @chardev
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_stat_readable_p
|
def test_stat_readable_p
|
||||||
|
|
Loading…
Add table
Reference in a new issue