tree-sitter-cli icon indicating copy to clipboard operation
tree-sitter-cli copied to clipboard

Re-print out test failures after the summary

Open robrix opened this issue 10 years ago • 1 comments

Running the tests, I get this nice little summary:

✗ Broken » 129 honored ∙ 1 broken (0.043s)

However then I have to go and scroll up to find the failed tests unless they happen to be at the end of the list. hspec addresses this by printing them out at the end in full:

Corpus
  crashers should not crash
    test/crashers/433.js FAILED [1]
  should produce the correct diff
    test/diffs/word-diffs.js FAILED [2]
  lists example fixtures
…lots of other tests…
Failures:

  test/CorpusSpec.hs:27: 
  1) Corpus, crashers should not crash, test/crashers/433.js
       uncaught exception: ErrorCall (./Data/Vector/Generic.hs:386 (slice): invalid slice (19,-13,22))

  test/CorpusSpec.hs:27: 
  2) Corpus, should produce the correct diff, test/diffs/word-diffs.js
       expected: True
        but got: False

Something like that would be handy when testing grammars in a terminal without much vertical space or when there are lots and lots of tests.

robrix avatar Feb 22 '16 18:02 robrix

Yeah that's a good call. Currently, I'm using vows to generate a test suite. Maybe there's a different vows formatter we could use.

maxbrunsfeld avatar Feb 22 '16 18:02 maxbrunsfeld