summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-03-28 10:47:04 -0400
committerKevin Newton <kddnewton@gmail.com>2024-03-28 12:04:35 -0400
commitd583616f32795de61ecd4efd60346c278873da7f (patch)
tree12e5a2e5aacc86f290105326396306bb93e58cb2 /test
parent35ff302893dfb1efd03ea17e76b9a09e2d3377a2 (diff)
[ruby/prism] Ensure deserialization works with errors+warnings>256
https://github.com/ruby/prism/commit/f540e830b5
Diffstat (limited to 'test')
-rw-r--r--test/prism/command_line_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/prism/command_line_test.rb b/test/prism/command_line_test.rb
index 96ceb2da38..4b04c36f3a 100644
--- a/test/prism/command_line_test.rb
+++ b/test/prism/command_line_test.rb
@@ -88,5 +88,24 @@ module Prism
assert_kind_of IntegerNode, result.value.statements.body.first
end
+
+ def test_command_line_x_implicit_fail
+ result = Prism.parse(<<~RUBY)
+ #!/bin/bash
+ exit 1
+ RUBY
+
+ assert_equal 1, result.errors.length
+ assert_equal :load, result.errors.first.level
+ end
+
+ def test_command_line_x_explicit_fail
+ result = Prism.parse(<<~RUBY, command_line: "x")
+ exit 1
+ RUBY
+
+ assert_equal 1, result.errors.length
+ assert_equal :load, result.errors.first.level
+ end
end
end