From 303abc5ab8ab695d11ccdef9f1460010704e02fe Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 27 Oct 2015 14:36:35 +0000 Subject: test_marshal.rb: test_no_internal_ids * test/ruby/test_marshal.rb (test_no_internal_ids): test for r52304, no internal IDs should be exposed by Marshal.dump. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_marshal.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 3548850a42..5aa13369a6 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -695,4 +695,20 @@ class TestMarshal < Test::Unit::TestCase Marshal.load(d) } end + + def test_no_internal_ids + opt = %w[--disable=gems] + args = [opt, 'Marshal.dump("",STDOUT)', true, true, encoding: Encoding::ASCII_8BIT] + out, err, status = EnvUtil.invoke_ruby(*args) + assert_empty(err) + assert_predicate(status, :success?) + expected = out + + opt << "--enable=frozen-string-literal" + opt << "--enable=frozen-string-literal-debug" + out, err, status = EnvUtil.invoke_ruby(*args) + assert_empty(err) + assert_predicate(status, :success?) + assert_equal(expected, out) + end end -- cgit v1.2.3