diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-11-19 05:41:17 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-11-19 05:41:17 +0000 |
commit | fefeb7132968d6e3cdd76d1ea3faf1dc1dcd3ec7 (patch) | |
tree | 1a3d0707bdd7e44257e1ab0101403ab107acc8c3 /test/test_tdb.rb | |
parent | 335ef754d1be2b2daacf5cdda9c14b1fc56a29ff (diff) | |
download | ruby-tdb-fefeb7132968d6e3cdd76d1ea3faf1dc1dcd3ec7.tar.gz |
We don't want path names silently truncated when passed to the C API.
Diffstat (limited to 'test/test_tdb.rb')
-rw-r--r-- | test/test_tdb.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_tdb.rb b/test/test_tdb.rb index 7ae581d..9b2ed71 100644 --- a/test/test_tdb.rb +++ b/test/test_tdb.rb @@ -16,6 +16,10 @@ class TestTdb < Test::Unit::TestCase @tdb.close if @tdb && ! @tdb.closed? end + def test_create_file_null_byte_in_path + assert_raises(ArgumentError) { TDB.new("hello.tdb\0") } + end + def test_create_file assert_nothing_raised do @tmp = Tempfile.new('tdb') |