Skip to content

Commit 2929c35

Browse files
committed
Fix up test suite
1 parent 6f663d1 commit 2929c35

File tree

4 files changed

+39
-38
lines changed

4 files changed

+39
-38
lines changed

rakelib/test.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require "rake/testtask"
55
config = lambda do |t|
66
t.libs << "test"
77
t.libs << "lib"
8-
t.test_files = FileList["test/prism/parse_stream_test.rb"]
8+
t.test_files = FileList["test/**/*_test.rb"]
99
end
1010

1111
Rake::TestTask.new(:test, &config)

src/prism.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8831,6 +8831,8 @@ pm_token_buffer_escape(pm_parser_t *parser, pm_token_buffer_t *token_buffer) {
88318831

88328832
const uint8_t *end = parser->current.end - 1;
88338833
pm_buffer_append_bytes(&token_buffer->buffer, start, (size_t) (end - start));
8834+
8835+
token_buffer->cursor = end;
88348836
}
88358837

88368838
/**

test/prism/parser_test.rb

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,22 @@ class ParserTest < TestCase
4545
base = File.join(__dir__, "fixtures")
4646

4747
# These files are erroring because of the parser gem being wrong.
48-
skip_incorrect = %w[
49-
embdoc_no_newline_at_end.txt
48+
skip_incorrect = [
49+
"embdoc_no_newline_at_end.txt"
5050
]
5151

5252
# These files are either failing to parse or failing to translate, so we'll
5353
# skip them for now.
54-
skip_all = skip_incorrect | %w[
55-
dash_heredocs.txt
56-
dos_endings.txt
57-
heredocs_with_ignored_newlines.txt
58-
regex.txt
59-
regex_char_width.txt
60-
spanning_heredoc.txt
61-
spanning_heredoc_newlines.txt
62-
tilde_heredocs.txt
63-
unescaping.txt
54+
skip_all = skip_incorrect | [
55+
"dash_heredocs.txt",
56+
"dos_endings.txt",
57+
"heredocs_with_ignored_newlines.txt",
58+
"regex.txt",
59+
"regex_char_width.txt",
60+
"spanning_heredoc.txt",
61+
"spanning_heredoc_newlines.txt",
62+
"tilde_heredocs.txt",
63+
"unescaping.txt"
6464
]
6565

6666
# Not sure why these files are failing on JRuby, but skipping them for now.
@@ -70,21 +70,21 @@ class ParserTest < TestCase
7070

7171
# These files are failing to translate their lexer output into the lexer
7272
# output expected by the parser gem, so we'll skip them for now.
73-
skip_tokens = %w[
74-
comments.txt
75-
constants.txt
76-
endless_range_in_conditional.txt
77-
heredoc_with_comment.txt
78-
heredoc_with_escaped_newline_at_start.txt
79-
heredocs_leading_whitespace.txt
80-
heredocs_nested.txt
81-
heredocs_with_ignored_newlines_and_non_empty.txt
82-
indented_file_end.txt
83-
non_alphanumeric_methods.txt
84-
range_begin_open_inclusive.txt
85-
single_quote_heredocs.txt
86-
strings.txt
87-
xstring.txt
73+
skip_tokens = [
74+
"comments.txt",
75+
"constants.txt",
76+
"endless_range_in_conditional.txt",
77+
"heredoc_with_comment.txt",
78+
"heredoc_with_escaped_newline_at_start.txt",
79+
"heredocs_leading_whitespace.txt",
80+
"heredocs_nested.txt",
81+
"heredocs_with_ignored_newlines_and_non_empty.txt",
82+
"indented_file_end.txt",
83+
"non_alphanumeric_methods.txt",
84+
"range_begin_open_inclusive.txt",
85+
"single_quote_heredocs.txt",
86+
"strings.txt",
87+
"xstring.txt"
8888
]
8989

9090
Dir["*.txt", base: base].each do |name|

test/prism/ripper_test.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,29 @@ class RipperTest < TestCase
2525
# Ripper cannot handle named capture groups in regular expressions.
2626
"regex.txt",
2727
"regex_char_width.txt",
28-
"whitequark/lvar_injecting_match.txt"
28+
"whitequark/lvar_injecting_match.txt",
29+
30+
# Ripper fails to understand some structures that span across heredocs.
31+
"spanning_heredoc.txt"
2932
]
3033

3134
omitted = [
3235
"dos_endings.txt",
3336
"heredocs_with_ignored_newlines.txt",
37+
"seattlerb/block_call_dot_op2_brace_block.txt",
38+
"seattlerb/block_command_operation_colon.txt",
39+
"seattlerb/block_command_operation_dot.txt",
3440
"seattlerb/heredoc__backslash_dos_format.txt",
3541
"seattlerb/heredoc_backslash_nl.txt",
3642
"seattlerb/heredoc_nested.txt",
3743
"seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt",
38-
"seattlerb/heredoc_squiggly_no_indent.txt",
39-
"spanning_heredoc.txt",
4044
"tilde_heredocs.txt",
4145
"unparser/corpus/semantic/dstr.txt",
4246
"whitequark/dedenting_heredoc.txt",
43-
"whitequark/parser_bug_640.txt",
4447
"whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt",
4548
"whitequark/parser_slash_slash_n_escaping_in_literals.txt",
46-
"whitequark/slash_newline_in_heredocs.txt",
47-
48-
"seattlerb/block_call_dot_op2_brace_block.txt",
49-
"seattlerb/block_command_operation_colon.txt",
50-
"seattlerb/block_command_operation_dot.txt",
51-
"whitequark/send_block_chain_cmd.txt"
49+
"whitequark/send_block_chain_cmd.txt",
50+
"whitequark/slash_newline_in_heredocs.txt"
5251
]
5352

5453
relatives.each do |relative|

0 commit comments

Comments
 (0)