From 4e86b76e8c0fc8218eff7dcaa2029cf778f260a7 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 3 Nov 2020 10:28:17 -0800 Subject: [PATCH] Update ruby error recovery test to reflect grammar tweaks --- test/fixtures/error_corpus/readme.md | 8 ++++++++ test/fixtures/error_corpus/ruby_errors.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/error_corpus/readme.md diff --git a/test/fixtures/error_corpus/readme.md b/test/fixtures/error_corpus/readme.md new file mode 100644 index 00000000..d8b5da09 --- /dev/null +++ b/test/fixtures/error_corpus/readme.md @@ -0,0 +1,8 @@ +The Error Corpus +================ + +This directory contains corpus tests that exercise error recovery in a variety of languages. + +These corpus tests provide a simple way of asserting that error recoveries are "reasonable" in a variety of situations. But they are also somewhat *overspecified*. It isn't critical that error recovery behaves *exactly* as these tests specify, just that most of the syntax tree is preserved despite the error. + +Sometimes these tests can start failing when changes are pushed to the parser repositories like `tree-sitter-ruby`, `tree-sitter-javascript`, etc. Usually, we just need to tweak the expected syntax tree. diff --git a/test/fixtures/error_corpus/ruby_errors.txt b/test/fixtures/error_corpus/ruby_errors.txt index 9c35781c..49dc2b32 100644 --- a/test/fixtures/error_corpus/ruby_errors.txt +++ b/test/fixtures/error_corpus/ruby_errors.txt @@ -14,6 +14,6 @@ c method: (identifier) (ERROR (heredoc_beginning)) arguments: (argument_list - (heredoc_body (heredoc_end)) + (heredoc_body (heredoc_content) (heredoc_end)) (identifier) (MISSING ")"))))