summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-12 04:35:16 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-12 04:35:16 +0000
commit7a0bc1f35098c5840eaee2b9ad69874d42b54139 (patch)
tree4db5e2cb57e32ad4075bf46db6d9f58e39133473
parent48e4f02fcb19fb653992f3539a87fb60a6f0a02e (diff)
test_jit.rb: prettify script in message
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_jit.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 67bbb669e9..c195bbdc53 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -470,7 +470,12 @@ class TestJIT < Test::Unit::TestCase
# The shortest way to test one proc
def assert_compile_once(script, result_inspect:)
- assert_eval_with_jit("p proc { #{script} }.call", stdout: "#{result_inspect}\n", success_count: 1)
+ if script.match?(/\A\n.+\n\z/m)
+ script = script.gsub(/^/, ' ')
+ else
+ script = " #{script} "
+ end
+ assert_eval_with_jit("p proc {#{script}}.call", stdout: "#{result_inspect}\n", success_count: 1)
end
# Shorthand for normal test cases