mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add a test for bug 18343
This already passes in master, 3.0, and 2.7, but would fail in ruby 2.6 as it segfaults instead of raising an exception. I think it's good to have a test for this to catch possible future regressions.
This commit is contained in:
parent
cbb057e677
commit
d1cbec9b52
Notes:
git
2021-11-17 12:29:18 +09:00
1 changed files with 8 additions and 0 deletions
|
@ -638,6 +638,14 @@ EXPECTED
|
|||
end;
|
||||
end
|
||||
|
||||
def test_bug_18343
|
||||
bug18343 = '[ruby-core:106096] [Bug #18343]'
|
||||
assert_separately(%W[- #{bug18343}], <<-'end;')
|
||||
bug = ARGV.shift
|
||||
assert_raise(ArgumentError, bug){[0].pack('c', {})}
|
||||
end;
|
||||
end
|
||||
|
||||
def test_pack_unpack_m0
|
||||
assert_equal("", [""].pack("m0"))
|
||||
assert_equal("AA==", ["\0"].pack("m0"))
|
||||
|
|
Loading…
Add table
Reference in a new issue