From 0e365eb6e3bad27c445eef28ca93ecc8c14faa3c Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 3 Jan 2024 03:40:07 -0600 Subject: [PATCH] Bless tests with current output --- .github/workflows/ci.yaml | 2 +- package.json | 2 +- test/corpus/statements.txt | 162 ++++++++++++++++++------------------- 3 files changed, 83 insertions(+), 83 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 27a1841..4b421fc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,6 +25,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - - run: npm install + - run: npm install --dev - run: npm test - run: tree-sitter parse test/*.just diff --git a/package.json b/package.json index 85568c8..34404c2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Treesitter grammar for Justfiles (casey/just)", "main": "grammar.js", "scripts": { - "test": "tree-sitter test", + "test": "tree-sitter test && tree-sitter parse test/*.json", "gen": "tree-sitter generate", "lint": "eslint grammar.js" }, diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt index 97d6045..3173a8c 100644 --- a/test/corpus/statements.txt +++ b/test/corpus/statements.txt @@ -19,7 +19,7 @@ foo := "abc" (STRING)))) (eol (NEWLINE))))) - + ================================================================================ expression ================================================================================ @@ -46,9 +46,8 @@ foo := "abc" + 'def' (eol (NEWLINE))))) - ================================================================================ -paths FIXME(paths) XFAIL from path operator +paths ================================================================================ relative := "abc" / 'def' @@ -67,39 +66,40 @@ combined := "foo" / bar() / baz (expression (value (string - (STRING)))) - (ERROR - (INDENT) - (UNEXPECTED ') - (RAW_STRING)) + (STRING))) + (expression + (value + (string + (RAW_STRING))))) (eol (NEWLINE)))) (item (assignment (NAME) - (ERROR - (UNEXPECTED ')) (expression (value - (NAME))) - (ERROR) + (cmd + (MISSING BACKTICK))) + (expression + (value + (string + (STRING))))) (eol (NEWLINE)))) (item (assignment (NAME) - (ERROR + (expression (value (string (STRING))) - (UNEXPECTED ') - (value - (call - (NAME))) - (UNEXPECTED ')) - (expression - (value - (NAME))) + (expression + (value + (call + (NAME))) + (expression + (value + (NAME))))) (eol (NEWLINE))))) @@ -122,67 +122,67 @@ corge := "foo\"bar" -------------------------------------------------------------------------------- (source_file - (item + (item + (eol + (NEWLINE))) + (item + (assignment + (NAME) + (expression + (value + (string + (STRING)))) (eol - (NEWLINE))) - (item - (assignment - (NAME) - (expression - (value - (string - (STRING)))) - (eol - (NEWLINE)))) - (item - (assignment - (NAME) - (expression - (value - (string - (RAW_STRING)))) - (eol - (NEWLINE)))) - (item - (assignment - (NAME) - (expression - (value - (string - (STRING)))) - (eol - (NEWLINE)))) - (item - (assignment - (NAME) - (expression - (value - (string - (INDENTED_STRING)))) - (eol - (NEWLINE)))) - (item - (assignment - (NAME) - (expression - (value - (string - (INDENTED_RAW_STRING)))) - (eol - (NEWLINE)))) - (item - (assignment - (NAME) - (ERROR - (value - (string - (STRING)))) - (expression - (value - (NAME))) - (ERROR) - (eol - (NEWLINE))))) + (NEWLINE)))) + (item + (assignment + (NAME) + (expression + (value + (string + (RAW_STRING)))) + (eol + (NEWLINE)))) + (item + (assignment + (NAME) + (expression + (value + (string + (STRING)))) + (eol + (NEWLINE)))) + (item + (assignment + (NAME) + (expression + (value + (string + (INDENTED_STRING)))) + (eol + (NEWLINE)))) + (item + (assignment + (NAME) + (expression + (value + (string + (INDENTED_RAW_STRING)))) + (eol + (NEWLINE)))) + (item + (assignment + (NAME) + (ERROR + (value + (string + (STRING)))) + (expression + (value + (NAME))) + (ERROR) + (eol + (NEWLINE))))) ================================================================================ if