ruby / spec

The Ruby Spec Suite aka ruby/spec
MIT License
588 stars 384 forks source link

Add specs for hash key ends with `!` or `?` #1148

Closed koic closed 3 months ago

koic commented 3 months ago

This PR adds several spec for the following syntax errors:

$ ruby -cve '{a!:}'
ruby 3.4.0dev (2024-04-18T03:46:51Z master b3c59370ca) [x86_64-darwin23]
-e:1: identifier a! is not valid to get
ruby: compile error (SyntaxError)

$ ruby -cve '{a?:}'
ruby 3.4.0dev (2024-04-18T03:46:51Z master b3c59370ca) [x86_64-darwin23]
-e:1: identifier a? is not valid to get
ruby: compile error (SyntaxError)

This addition supplements some specs for the non-omitting value hash notation.