Suppress warnings by other than self-assignments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d389d6510
commit
33118bf77b
@ -174,6 +174,7 @@ class TestParse < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
c = Class.new
|
c = Class.new
|
||||||
|
c.freeze
|
||||||
assert_nothing_raised(SyntaxError) do
|
assert_nothing_raised(SyntaxError) do
|
||||||
eval <<-END, nil, __FILE__, __LINE__+1
|
eval <<-END, nil, __FILE__, __LINE__+1
|
||||||
if false
|
if false
|
||||||
@ -183,7 +184,6 @@ class TestParse < Test::Unit::TestCase
|
|||||||
END
|
END
|
||||||
end
|
end
|
||||||
|
|
||||||
c = Class.new
|
|
||||||
assert_raise(SyntaxError) do
|
assert_raise(SyntaxError) do
|
||||||
eval <<-END, nil, __FILE__, __LINE__+1
|
eval <<-END, nil, __FILE__, __LINE__+1
|
||||||
$1 &= 1
|
$1 &= 1
|
||||||
@ -698,15 +698,17 @@ x = __ENCODING__
|
|||||||
def test_invalid_char
|
def test_invalid_char
|
||||||
bug10117 = '[ruby-core:64243] [Bug #10117]'
|
bug10117 = '[ruby-core:64243] [Bug #10117]'
|
||||||
invalid_char = /Invalid char `\\x01'/
|
invalid_char = /Invalid char `\\x01'/
|
||||||
x = x = 1
|
x = 1
|
||||||
assert_in_out_err(%W"-e \x01x", "", [], invalid_char, bug10117)
|
assert_in_out_err(%W"-e \x01x", "", [], invalid_char, bug10117)
|
||||||
assert_syntax_error("\x01x", invalid_char, bug10117)
|
assert_syntax_error("\x01x", invalid_char, bug10117)
|
||||||
assert_equal(nil, eval("\x04x"))
|
assert_equal(nil, eval("\x04x"))
|
||||||
|
assert_equal 1, x
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_literal_concat
|
def test_literal_concat
|
||||||
x = x = "baz"
|
x = "baz"
|
||||||
assert_equal("foobarbaz", eval('"foo" "bar#{x}"'))
|
assert_equal("foobarbaz", eval('"foo" "bar#{x}"'))
|
||||||
|
assert_equal("baz", x)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_unassignable
|
def test_unassignable
|
||||||
@ -776,7 +778,7 @@ x = __ENCODING__
|
|||||||
$VERBOSE = true
|
$VERBOSE = true
|
||||||
stderr = $stderr
|
stderr = $stderr
|
||||||
$stderr = StringIO.new("")
|
$stderr = StringIO.new("")
|
||||||
x = x = 1
|
x = 1
|
||||||
assert_nil eval("x; nil")
|
assert_nil eval("x; nil")
|
||||||
assert_nil eval("1+1; nil")
|
assert_nil eval("1+1; nil")
|
||||||
assert_nil eval("1.+(1); nil")
|
assert_nil eval("1.+(1); nil")
|
||||||
@ -789,6 +791,7 @@ x = __ENCODING__
|
|||||||
assert_nil eval("true; nil")
|
assert_nil eval("true; nil")
|
||||||
assert_nil eval("false; nil")
|
assert_nil eval("false; nil")
|
||||||
assert_nil eval("defined?(1); nil")
|
assert_nil eval("defined?(1); nil")
|
||||||
|
assert_equal 1, x
|
||||||
|
|
||||||
assert_raise(SyntaxError) do
|
assert_raise(SyntaxError) do
|
||||||
eval %q(1; next; 2)
|
eval %q(1; next; 2)
|
||||||
@ -843,10 +846,11 @@ x = __ENCODING__
|
|||||||
end
|
end
|
||||||
|
|
||||||
assert_nothing_raised do
|
assert_nothing_raised do
|
||||||
x = x = "bar"
|
x = "bar"
|
||||||
eval <<-END, nil, __FILE__, __LINE__+1
|
eval <<-END, nil, __FILE__, __LINE__+1
|
||||||
:"foo#{"x"}baz" ? 1 : 2
|
:"foo#{"x"}baz" ? 1 : 2
|
||||||
END
|
END
|
||||||
|
assert_equal "bar", x
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user