summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authoryui-knk <[email protected]>2024-03-24 08:39:27 +0900
committerYuichiro Kaneko <[email protected]>2024-04-02 08:26:58 +0900
commit799e854897856e431c03a5122252358e2c57aff2 (patch)
tree4918d58d1bdcdb229c2419d381743007b62e1d2d /test/ruby/test_syntax.rb
parent8066e3ea6e9462f510e5d0da887be94b18cce50b (diff)
[Feature #20331] Simplify parser warnings for hash keys duplication and when clause duplication
This commit simplifies warnings for hash keys duplication and when clause duplication, based on the discussion of https://bugs.ruby-lang.org/issues/20331. Warnings are reported only when strings are same to ohters.
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 371c41fe37..7cc5e542a7 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -734,7 +734,7 @@ WARN
end
}
}
- assert_warning(/3: #{w}.+4: #{w}.+4: #{w}.+5: #{w}.+5: #{w}/m) {
+ assert_warning(/3: #{w}/m) {
eval %q{
case 1
when __LINE__, __LINE__
@@ -743,7 +743,7 @@ WARN
end
}
}
- assert_warning(/3: #{w}.+4: #{w}.+4: #{w}.+5: #{w}.+5: #{w}/m) {
+ assert_warning(/3: #{w}/m) {
eval %q{
case 1
when __FILE__, __FILE__