summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Dalessio <mike.dalessio@gmail.com>2023-08-20 16:38:49 -0400
committergit <svn-admin@ruby-lang.org>2023-08-21 19:00:52 +0000
commit461f8eaba74a7475bf97921e3ed45b63b126a190 (patch)
tree484b0a2d61a1b70f3a4f69de94aa10aedaf65bfd /test
parentca6db02c2a305bc990c144439996abfe984a6c5a (diff)
[ruby/yarp] fix: parsing a '%' expression with a CR but not a newline
Previously this failed an assertion and aborted. https://github.com/ruby/yarp/commit/a037d942a8
Diffstat (limited to 'test')
-rw-r--r--test/yarp/errors_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/yarp/errors_test.rb b/test/yarp/errors_test.rb
index 355e7a8aff..cab785d7c6 100644
--- a/test/yarp/errors_test.rb
+++ b/test/yarp/errors_test.rb
@@ -162,6 +162,12 @@ class ErrorsTest < Test::Unit::TestCase
]
end
+ def test_cr_without_lf_in_percent_expression
+ assert_errors expression("%\r"), "%\r", [
+ ["Invalid %% token", 0..3],
+ ]
+ end
+
def test_1_2_3
assert_errors expression("(1, 2, 3)"), "(1, 2, 3)", [
["Expected to be able to parse an expression.", 2..2],