summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 74ea75ee42..dbeee825da 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -754,4 +754,18 @@ class TestMarshal < Test::Unit::TestCase
Marshal.dump(obj)
end
end
+
+ ruby2_keywords def ruby2_keywords_hash(*a)
+ a.last
+ end
+
+ def ruby2_keywords_test(key: 1)
+ key
+ end
+
+ def test_marshal_with_ruby2_keywords_hash
+ flagged_hash = ruby2_keywords_hash(key: 42)
+ hash = Marshal.load(Marshal.dump(flagged_hash))
+ assert_equal(42, ruby2_keywords_test(*[hash]))
+ end
end