mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_syntax.rb: more test_warn_balanced
* test/ruby/test_syntax.rb (test_warn_balanced): more assertions for a symbol literal and a local variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e9fa549539
commit
0e547e6392
1 changed files with 8 additions and 2 deletions
|
@ -311,8 +311,14 @@ WARN
|
|||
[:/, "regexp literal"],
|
||||
[:%, "string literal"],
|
||||
].each do |op, syn|
|
||||
assert_warning(warning % [op, syn]) do
|
||||
assert_valid_syntax("puts 1 #{op}0", "test", verbose: true)
|
||||
all_assertions do |a|
|
||||
["puts 1 #{op}0", "puts :a #{op}0", "m = 1; puts m #{op}0"].each do |src|
|
||||
a.for(src) do
|
||||
assert_warning(warning % [op, syn], src) do
|
||||
assert_valid_syntax(src, "test", verbose: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue