aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_parse.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r--test/ruby/test_parse.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index c8f47d6224..89b5ef1993 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -854,15 +854,21 @@ x = __ENCODING__
def test_shadowing_variable
assert_warning(/shadowing outer local variable/) {eval("a=1; tap {|a|}")}
+ a = "\u{3042}"
+ assert_warning(/#{a}/o) {eval("#{a}=1; tap {|#{a}|}")}
end
def test_unused_variable
o = Object.new
assert_warning(/assigned but unused variable/) {o.instance_eval("def foo; a=1; nil; end")}
+ a = "\u{3042}"
+ assert_warning(/#{a}/) {o.instance_eval("def foo; #{a}=1; nil; end")}
end
def test_named_capture_conflict
a = 1
assert_warning(/named capture conflict/) {eval("a = 1; /(?<a>)/ =~ ''")}
+ a = "\u{3042}"
+ assert_warning(/#{a}/) {eval("#{a} = 1; /(?<#{a}>)/ =~ ''")}
end
end