diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-27 01:10:33 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-27 01:21:17 +0000 |
commit | 9c14d0c61ae5c9ed16604d03d70dc3c4765563d0 (patch) | |
tree | d3b6cf7b4cfb9342f39d1baca4880a106ced9be0 /test.rb | |
parent | c661c9be8b6ea636d0504136a06f8d98a6af3195 (diff) | |
download | mahoro-9c14d0c61ae5c9ed16604d03d70dc3c4765563d0.tar.gz |
disallow '\0' in C strings
It's a bug in user code if we try to open files with '\0' in it.
Diffstat (limited to 'test.rb')
-rwxr-xr-x | test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -22,6 +22,10 @@ class MahoroTestCase < Test::Unit::TestCase }.include?(@m.file('mahoro.c'))) end + def test_null_byte_in_path + assert_raises(ArgumentError) { @m.file("mahoro.c\0foo") } + end + def test_buffer @m.flags = Mahoro::NONE assert_equal('ASCII C program text', |