summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-07-17 15:30:03 -0400
committergit <[email protected]>2024-07-17 19:44:32 +0000
commite77e4aa608a12ea59cefc87abafd72fb2b0c0b9a (patch)
tree96ed90556004047807a8899a8e3c4e146eb2e5e8 /test
parent0fe816f3808cdf647ac549a8ddb2e0540320b890 (diff)
[ruby/prism] Have parse_stream handle NUL bytes
https://github.com/ruby/prism/commit/4a41d298c8
Diffstat (limited to 'test')
-rw-r--r--test/prism/api/parse_stream_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/prism/api/parse_stream_test.rb b/test/prism/api/parse_stream_test.rb
index 0edee74cc2..1c068c617c 100644
--- a/test/prism/api/parse_stream_test.rb
+++ b/test/prism/api/parse_stream_test.rb
@@ -69,5 +69,13 @@ module Prism
assert result.success?
assert_equal 4, result.value.statements.body.length
end
+
+ def test_nul_bytes
+ io = StringIO.new("1 # \0\0\0 \n2 # \0\0\0\n3")
+ result = Prism.parse_stream(io)
+
+ assert result.success?
+ assert_equal 3, result.value.statements.body.length
+ end
end
end