Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong test result output for missing ")" token #2819

Closed
alaviss opened this issue Dec 11, 2023 · 2 comments · Fixed by #3016
Closed

Wrong test result output for missing ")" token #2819

alaviss opened this issue Dec 11, 2023 · 2 comments · Fixed by #3016

Comments

@alaviss
Copy link
Contributor

alaviss commented Dec 11, 2023

Grammar:

module.exports = grammar({
  name: "bug",

  rules: {
    source_file: (_) => seq("(", ")"),
  },
});

Corpus corpus/error.txt:

===
Err
===

(

---

Running tests:

1 failure:

expected / actual

  1. Err:

    (source_file
      (MISSING "))
)

As you can see, the closing " is missing and the associated ) as well.

Expected output:

1 failure:

expected / actual

  1. Err:

    (source_file
      (MISSING ")"))
)

Testing against corpus updated with -u also fails:

================================================================================
Err
================================================================================

(

--------------------------------------------------------------------------------

(source_file
  (MISSING "))

Output:

  err:
    ✗ Err

1 failure:

expected / actual

  1. Err:

    (source_file
      (MISSING "))

Surprisingly, no "expected/actual" diff here, just that this was "invalid".

@Plentywolf
Copy link

Invalid?

@alaviss
Copy link
Contributor Author

alaviss commented Dec 11, 2023

The test was marked as a fail even though the output is identical to the expected result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants