aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-10-12 11:10:17 -0400
committerKevin Newton <kddnewton@gmail.com>2023-10-13 15:31:30 -0400
commitd06523bc52a4486db4193d7a6771e76c31157777 (patch)
tree02ae9cc3e89c4f98fbc3640c1c7f8e8d4d764925 /test
parent2de0299839e01f3f96554dc55ed20437553326ac (diff)
downloadruby-d06523bc52a4486db4193d7a6771e76c31157777.tar.gz
[ruby/prism] Remove now-defunct semantic_field from nodes
https://github.com/ruby/prism/commit/c82a9dad64
Diffstat (limited to 'test')
-rw-r--r--test/prism/unescape_test.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/prism/unescape_test.rb b/test/prism/unescape_test.rb
index e645b1dc19..29c2137bdb 100644
--- a/test/prism/unescape_test.rb
+++ b/test/prism/unescape_test.rb
@@ -131,11 +131,11 @@ module Prism
(0...256).each do |ord|
# I think this might be a bug in Ruby.
next if context.name == "?" && ord == 0xFF
-
+
# We don't currently support scanning for the number of capture groups
# to validate backreferences so these are all going to fail.
next if (context.name == "//" || context.name.start_with?("%r")) && ord.chr.start_with?(/\d/)
-
+
# \a \b \c ...
assert_unescape(context, ord.chr)
end
@@ -162,8 +162,12 @@ module Prism
# \u0000 \u0001 \u0002 ...
assert_unescape(context, "u#{["5"].concat(hex.sample(3)).join}")
- # \u{00 00} ...
- assert_unescape(context, "u{00#{["5"].concat(hex.sample(3)).join} \t\v 00#{["5"].concat(hex.sample(3)).join}}")
+ # The behavior of whitespace in the middle of these escape sequences
+ # changed in Ruby 3.3.0, so we only want to test against latest.
+ if RUBY_VERSION >= "3.3.0"
+ # \u{00 00} ...
+ assert_unescape(context, "u{00#{["5"].concat(hex.sample(3)).join} \t\v 00#{["5"].concat(hex.sample(3)).join}}")
+ end
(0...128).each do |ord|
chr = ord.chr