frozolotl / tree-sitter-typst

A tree-sitter grammar for the typst typesetting language with a focus on correctness
European Union Public License 1.2
76 stars 3 forks source link

Why all tests ran by `tree-sitter test` show errors? #8

Closed Ziqi-Yang closed 11 months ago

Ziqi-Yang commented 1 year ago

steps to reproduce:

# git pull repo
# change current directory to project root directory
tree-sitter test # or `tree-sitter test | less -R` since the output is quite long

Then it shows that all tests have errors.
Sample errors:

  1. Inline code expression:

    (source_file
      (identifier)) // red
      (markup // green
        (text)
        (space)
        (embedded_code_expr
          (code_ident))
        (space)
        (text)))

  2. Identifier:

    (source_file
      (identifier)) // red
      (markup // green
        (embedded_code_expr
          (code_ident))))

  3. Empty content block:

    (source_file
      (content_block)) // red
      (markup // green
        (embedded_code_expr
          (content_block))))

  4. Content block with content:

    (source_file
      (content_block)) // red
      (markup // green
        (embedded_code_expr
          (content_block
            (markup
              (text))))))
// ...

I've also tried this procedures(below), but the errors remained:

npm install --save
./node_modules/tree-sitter-cli/tree-sitter test
frozolotl commented 1 year ago

Following the instructions you have given, I can't reproduce this problem on my machine. No tests fail.