summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2024-02-01 15:55:49 -0500
committergit <svn-admin@ruby-lang.org>2024-02-01 22:04:46 +0000
commit770b5499a550956001b879abb5bbd205eabda19f (patch)
treec27ac78df081f52a99128c918120c52348329dca /test
parent4fbdbde0887d038c679b9e0369234d1061441232 (diff)
[ruby/prism] Amend assert in pm_utf_8_codepoint(), n=0 is fine
This assert used to trip in the included test: ``` ./miniruby --parser=prism -e ' "%W"\u" ' ``` https://github.com/ruby/prism/commit/8c0f84db4f
Diffstat (limited to 'test')
-rw-r--r--test/prism/format_errors_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/prism/format_errors_test.rb b/test/prism/format_errors_test.rb
index 34d320a7b6..bc0b26165d 100644
--- a/test/prism/format_errors_test.rb
+++ b/test/prism/format_errors_test.rb
@@ -12,6 +12,13 @@ module Prism
| ^ unexpected '<', ignoring it
| ^ unexpected '>', ignoring it
ERROR
+
+ assert_equal <<~'ERROR', Debug.format_errors('"%W"\u"', false)
+ > 1 | "%W"\u"
+ | ^ expected a newline or semicolon after the statement
+ | ^ invalid token
+ | ^ expected a closing delimiter for the string literal
+ ERROR
end
end
end