summaryrefslogtreecommitdiff
path: root/test/prism/unescape_test.rb
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-10-10 14:37:06 -0400
committerKevin Newton <kddnewton@gmail.com>2023-10-13 15:31:30 -0400
commitf64a0434dd215dbefa8c38e8768c68ea431e8d01 (patch)
tree3ed9efc90393f5c3236f89aa420ef56fcd01d536 /test/prism/unescape_test.rb
parent5fc34f1cde041e72597c873d3ada8f3b039b991f (diff)
[ruby/prism] Use current_string to handle %I
https://github.com/ruby/prism/commit/831d5f4b45
Diffstat (limited to 'test/prism/unescape_test.rb')
-rw-r--r--test/prism/unescape_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/prism/unescape_test.rb b/test/prism/unescape_test.rb
index 4104b051dd..0053fdd364 100644
--- a/test/prism/unescape_test.rb
+++ b/test/prism/unescape_test.rb
@@ -75,6 +75,7 @@ module Prism
ascii = (0...128).map(&:chr)
ascii8 = (128...256).map(&:chr)
+ newlines = ["\r\n"]
octal = [*("0".."7")]
octal = octal.product(octal).map(&:join).concat(octal.product(octal).product(octal).map(&:join))
@@ -90,7 +91,8 @@ module Prism
ctrls = (ascii.grep(/[[:print:]]/) - ["\\"]).flat_map { |c| ["C-#{c}", "c#{c}", "M-#{c}", "M-\\C-#{c}", "M-\\c#{c}", "c\\M-#{c}"] }
- escapes = [*ascii, *ascii8, *octal, *hex2, *hex4, *hex6, *ctrls]
+ escapes = [*ascii, *ascii8, *newlines, *octal, *hex2, *hex4, *hex6, *ctrls]
+
contexts = [
[Context::String.new("?", ""), escapes],
# [Context::String.new("'", "'"), escapes],
@@ -106,7 +108,7 @@ module Prism
[Context::List.new("%w[", "]"), escapes],
[Context::List.new("%W[", "]"), escapes],
[Context::List.new("%i[", "]"), escapes],
- # [Context::List.new("%I[", "]"), escapes],
+ [Context::List.new("%I[", "]"), escapes],
# [Context::Symbol.new("%s[", "]"), escapes],
# [Context::Symbol.new(":'", "'"), escapes],
# [Context::Symbol.new(":\"", "\""), escapes],