From e77e4aa608a12ea59cefc87abafd72fb2b0c0b9a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 17 Jul 2024 15:30:03 -0400 Subject: [ruby/prism] Have parse_stream handle NUL bytes https://github.com/ruby/prism/commit/4a41d298c8 --- test/prism/api/parse_stream_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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 -- cgit v1.2.3