phile314 / tasty-silver

A fancy test runner for tasty and support for golden tests.
MIT License
11 stars 3 forks source link

`tasty-silver`s own testsuite produces somewhat garbled output #29

Closed andreasabel closed 3 years ago

andreasabel commented 3 years ago
$ cabal test -j1 --test-show-details=direct
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
 - tasty-silver-3.2.3 (test:test) (first run)
Preprocessing test suite 'test' for tasty-silver-3.2.3..
Building test suite 'test' for tasty-silver-3.2.3..
Running 1 test suites...
Test suite test: RUNNING...
tests
  findByExtension: [2?22m5lOKcheck res:  (0.01s)OK

  withResource:      Created golden file.

All 1 tests passed (0.00s)
OK (0.00s)
  Filter.checkRF
    empty1a:       OK (0.00s)
    empty1b:       OK (0.00s)
    empty2a:       OK (0.00s)
    empty2b:       OK (0.00s)

All 6 tests passed (0.01s)
Screenshot 2021-09-04 at 01 02 19

I wonder why first All 1 tests passed is reported when the final All 6 tests passed covers everything (there are 6 tests altogether). https://github.com/phile314/tasty-silver/blob/5640d7fbd5d8927feff219153a6cac1e392db254/tests/test.hs#L21 https://github.com/phile314/tasty-silver/blob/5640d7fbd5d8927feff219153a6cac1e392db254/tests/test.hs#L63-L69

Likely, the explanation is that there is a test-in-a-test!? https://github.com/phile314/tasty-silver/blob/5640d7fbd5d8927feff219153a6cac1e392db254/tests/test.hs#L56 Anyway, it is unfortunate that the test report is interrupted in the middle of an escape sequence. The output with --test-show-details=streaming isn't colored, but not much better:

Test suite test: RUNNING...
tests
  findByExtension: OK (check res: 0.0OK0s
)
  Created golden file.
  withResource:    
All 1 tests passed (0.00s)
OK (0.00s)
  Filter.checkRF
    empty1a:       OK (0.00s)
    empty1b:       OK (0.00s)
    empty2a:       OK (0.00s)
    empty2b:       OK (0.00s)

All 6 tests passed (0.01s)