Skip to content

Commit

Permalink
Fixed failure for test_splat_asgn_splat_nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Brannan committed Dec 14, 2009
1 parent ed19eef commit dd26a2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/test_ludicrous.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,14 @@ def foo(a=10, *rest)
assert_equal([], rest)
end

def splat_nil
return *nil
end

def test_return_splat_nil
foo = Class.new { def foo; return *nil; end }
bar = Class.new { def foo; return *nil; end }
result = compile_and_run(foo.new, :foo)
assert_equal(bar.new.foo, result) # different behavior on 1.8 and 1.9
assert_equal(splat_nil, result) # different behavior on 1.8 and 1.9
end

def test_splat_asgn_nil
Expand All @@ -443,7 +446,7 @@ def foo
end
end
result = compile_and_run(foo.new, :foo)
assert_equal([nil], result)
assert_equal(splat_nil, result)
end

# TODO: not a very good test, we're really just making sure that we
Expand Down

0 comments on commit dd26a2b

Please sign in to comment.