@@ -48,58 +48,11 @@ def test_parse_lex_file
4848 end
4949
5050 if RUBY_VERSION >= "3.3"
51- def test_lex_compat
52- source = "foo bar"
53- prism = Prism . lex_compat ( source , version : "current" ) . value
54- ripper = Ripper . lex ( source )
51+ def test_lex_compare
52+ prism = Prism . lex_compat ( File . read ( __FILE__ ) , version : "current" ) . value
53+ ripper = Ripper . lex ( File . read ( __FILE__ ) )
5554 assert_equal ( ripper , prism )
5655 end
5756 end
58-
59- def test_lex_interpolation_unterminated
60- assert_equal (
61- %i[ STRING_BEGIN EMBEXPR_BEGIN EOF ] ,
62- token_types ( '"#{' )
63- )
64-
65- assert_equal (
66- %i[ STRING_BEGIN EMBEXPR_BEGIN IGNORED_NEWLINE EOF ] ,
67- token_types ( '"#{' + "\n " )
68- )
69- end
70-
71- def test_lex_interpolation_unterminated_with_content
72- # FIXME: Emits EOL twice.
73- assert_equal (
74- %i[ STRING_BEGIN EMBEXPR_BEGIN CONSTANT EOF EOF ] ,
75- token_types ( '"#{C' )
76- )
77-
78- assert_equal (
79- %i[ STRING_BEGIN EMBEXPR_BEGIN CONSTANT NEWLINE EOF ] ,
80- token_types ( '"#{C' + "\n " )
81- )
82- end
83-
84- def test_lex_heredoc_unterminated
85- code = <<~'RUBY' . strip
86- <<A+B
87- #{C
88- RUBY
89-
90- assert_equal (
91- %i[ HEREDOC_START EMBEXPR_BEGIN CONSTANT HEREDOC_END PLUS CONSTANT NEWLINE EOF ] ,
92- token_types ( code )
93- )
94-
95- assert_equal (
96- %i[ HEREDOC_START EMBEXPR_BEGIN CONSTANT NEWLINE HEREDOC_END PLUS CONSTANT NEWLINE EOF ] ,
97- token_types ( code + "\n " )
98- )
99- end
100-
101- def token_types ( code )
102- Prism . lex ( code ) . value . map { |token , _state | token . type }
103- end
10457 end
10558end
0 commit comments