Add a test case for __LINE__ assignment in condition warning

This commit is contained in:
yui-knk 2024-01-01 10:24:25 +09:00 committed by Yuichiro Kaneko
parent 6ec4d203f7
commit 5993d0f5f2

View File

@ -578,6 +578,15 @@ class TestRubyOptions < Test::Unit::TestCase
feature4299 = '[ruby-dev:43083]'
assert_in_out_err(["-w", t.path], "", [], err, feature4299)
assert_in_out_err(["-wr", t.path, "-e", ""], "", [], err, feature4299)
t.rewind
t.truncate(0)
t.puts "if a = __LINE__; end"
t.flush
err = ["#{t.path}:1:#{warning}",
]
assert_in_out_err(["-w", t.path], "", [], err)
assert_in_out_err(["-wr", t.path, "-e", ""], "", [], err)
}
end