summaryrefslogtreecommitdiff
path: root/test/ruby/test_lambda.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_lambda.rb')
-rw-r--r--test/ruby/test_lambda.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb
index 7738034240..c1858a36dd 100644
--- a/test/ruby/test_lambda.rb
+++ b/test/ruby/test_lambda.rb
@@ -163,7 +163,7 @@ class TestLambdaParameters < Test::Unit::TestCase
end
def test_proc_inside_lambda_toplevel
- assert_separately [], <<~RUBY
+ assert_ruby_status [], <<~RUBY
lambda{
$g = proc{ return :pr }
}.call
@@ -276,27 +276,27 @@ class TestLambdaParameters < Test::Unit::TestCase
end
def test_do_lambda_source_location
- exp_lineno = __LINE__ + 3
+ exp = [__LINE__ + 1, 10, __LINE__ + 5, 7]
lmd = ->(x,
y,
z) do
#
end
- file, lineno = lmd.source_location
+ file, *loc = lmd.source_location
assert_match(/^#{ Regexp.quote(__FILE__) }$/, file)
- assert_equal(exp_lineno, lineno, "must be at the beginning of the block")
+ assert_equal(exp, loc)
end
def test_brace_lambda_source_location
- exp_lineno = __LINE__ + 3
+ exp = [__LINE__ + 1, 10, __LINE__ + 5, 5]
lmd = ->(x,
y,
z) {
#
}
- file, lineno = lmd.source_location
+ file, *loc = lmd.source_location
assert_match(/^#{ Regexp.quote(__FILE__) }$/, file)
- assert_equal(exp_lineno, lineno, "must be at the beginning of the block")
+ assert_equal(exp, loc)
end
def test_not_orphan_return