summaryrefslogtreecommitdiff
path: root/test/prism/errors
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2025-11-29 14:14:48 -0500
committergit <svn-admin@ruby-lang.org>2025-11-29 19:47:45 +0000
commitf2a6cb2dc88ca12938b45f35bc6e64d72060a959 (patch)
tree1dae42b1f01284998b0bb68129dbb544a6c47b3b /test/prism/errors
parent48a73303e45b1dbaa3422e14e35c7834db98be4d (diff)
[ruby/prism] Handle invalid string pattern key
When a pattern match is using a string as a hash pattern key and is using it incorrectly, we were previously assuming it was a symbol. In the case of an error, that's not the case. So we need to add a missing node in this case. https://github.com/ruby/prism/commit/f0b06d6269
Diffstat (limited to 'test/prism/errors')
-rw-r--r--test/prism/errors/pattern_string_key.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/prism/errors/pattern_string_key.txt b/test/prism/errors/pattern_string_key.txt
new file mode 100644
index 0000000000..9f28feddb9
--- /dev/null
+++ b/test/prism/errors/pattern_string_key.txt
@@ -0,0 +1,8 @@
+case:a
+in b:"","#{}"
+ ^~~~~ expected a label after the `,` in the hash pattern
+ ^ expected a pattern expression after the key
+ ^ expected a delimiter after the patterns of an `in` clause
+ ^ unexpected end-of-input, assuming it is closing the parent top level context
+ ^ expected an `end` to close the `case` statement
+