diff options
author | Kevin Newton <[email protected]> | 2023-11-27 14:17:02 -0500 |
---|---|---|
committer | git <[email protected]> | 2023-11-28 13:25:48 +0000 |
commit | c798943a4a272f213d21295a837da06ed5fa9a51 (patch) | |
tree | 618a074700e2d501beec4db66320e2e1f5a6f085 /test/prism/comments_test.rb | |
parent | 43dc8e9012dd7c390f1299d1b653656c81ae2aa7 (diff) |
[ruby/prism] Move DATA parsing into its own parse result field
https://github.com/ruby/prism/commit/42b60b6e95
Diffstat (limited to 'test/prism/comments_test.rb')
-rw-r--r-- | test/prism/comments_test.rb | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/test/prism/comments_test.rb b/test/prism/comments_test.rb index d14409458c..b99c00268c 100644 --- a/test/prism/comments_test.rb +++ b/test/prism/comments_test.rb @@ -39,37 +39,23 @@ module Prism ) end - def test_comment___END__ - source = <<~RUBY + def test___END__ + result = Prism.parse(<<~RUBY) __END__ comment RUBY - assert_comment( - source, - DATAComment, - start_offset: 0, - end_offset: 16, - start_line: 1, - end_line: 3, - start_column: 0, - end_column: 0 - ) + data_loc = result.data_loc + assert_equal 0, data_loc.start_offset + assert_equal 16, data_loc.end_offset end - def test_comment___END__crlf - source = "__END__\r\ncomment\r\n" + def test___END__crlf + result = Prism.parse("__END__\r\ncomment\r\n") - assert_comment( - source, - DATAComment, - start_offset: 0, - end_offset: 18, - start_line: 1, - end_line: 3, - start_column: 0, - end_column: 0 - ) + data_loc = result.data_loc + assert_equal 0, data_loc.start_offset + assert_equal 18, data_loc.end_offset end def test_comment_embedded_document |