racket / rackunit

Other
18 stars 34 forks source link

Wrong test counts from (test-log) when using (test-case) #119

Closed tilk closed 4 years ago

tilk commented 4 years ago

When running the following program:

#lang racket
(require rackunit rackunit/log)
(test-case "?!?" (check-true #f))
(test-log)

I get the output:

'(1 . 2)

But I expected '(1 . 1) as there was only one test, and no test succeeded.

jeapostrophe commented 4 years ago

test-case counts as a test.

tilk commented 4 years ago

Then why is it counted as successful? Did it successfully fail? ;)

When I run the following program (which is almost the same as the previous one, only it always succeeds instead of failing):

#lang racket
(require rackunit rackunit/log)
(test-case "?!?" (check-true #t))
(test-log)

I get the output:

'(0 . 1)

So if the test succeeds, it's not counted as a test.

bennn commented 4 years ago

Are you using the 7.6 release?

This issue looks similar to #113

tilk commented 4 years ago

I'm using Racket v7.6.

bennn commented 4 years ago

Ah, well then I guess the 7.6 release didn't include the commit that fixes this (https://github.com/racket/rackunit/commit/8396329619ff735f71ecb070bf7ae88690bc860f).

I get the output '(1 . 1) on the first program and '(0 . 1) on the second. On 7.6 I see '(1 . 2) for the first.

Until the 7.7 release, you could move to a snapshot build or try installing RackUnit from source