diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2022-11-30 15:04:31 -0500 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2022-11-30 16:27:39 -0500 |
| commit | 5752d11f1f33d277356373da749db111e03c96b5 (patch) | |
| tree | 0d59152aa8fe241eb98f10dc85bddffc84420620 /test/ruby | |
| parent | 4b9d10b8330b5072993f2c32eaf701c5c1aa7e55 (diff) | |
Use RTEST and add test for GH-6832
Technically we shouldn't see Qfalse now, but RTEST also compiles down to
just one branch anyways. Pretty contrived issue, but easy to fix.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6832
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_marshal.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index fc5cd9e93e..6cd0b9acc3 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -92,6 +92,14 @@ class TestMarshal < Test::Unit::TestCase TestMarshal.instance_eval { remove_const :StructInvalidMembers } end + def test_load_range_as_struct + assert_raise(TypeError, 'GH-6832') do + # Can be obtained with: + # $ ruby -e 'Range = Struct.new(:a, :b, :c); p Marshal.dump(Range.new(nil, nil, nil))' + Marshal.load("\x04\bS:\nRange\b:\x06a0:\x06b0:\x06c0") + end + end + class C def initialize(str) @str = str |
