racket / rackunit

Other
18 stars 32 forks source link

Improve check-match failure message #164

Closed AlexKnauth closed 8 months ago

AlexKnauth commented 1 year ago

Fixes #163 by changing the expected check-info in pretty-print mode into a pattern check-info in write mode, and adding a condition check-info in write mode when there's a condition that must pass too.

The new messages look like this:

--------------------
. FAILURE
name:       check-match
location:   meow.rkt:5:0
actual:     1
pattern:    a
condition:  (symbol? a)
--------------------
--------------------
. FAILURE
name:       check-match
location:   meow.rkt:10:0
actual:     '(1)
pattern:    `(,a)
condition:  (symbol? a)
--------------------
--------------------
. FAILURE
name:       check-match
location:   meow.rkt:15:0
actual:     'a
pattern:    a
condition:  (integer? a)
--------------------