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

Bad error with check-match #163

Closed
wilbowma opened this issue Feb 15, 2023 · 1 comment · Fixed by #164
Closed

Bad error with check-match #163

wilbowma opened this issue Feb 15, 2023 · 1 comment · Fixed by #164

Comments

@wilbowma
Copy link
Contributor

What version of Racket are you using?
8.7 [cs]

What program did you run?

#lang racket

(require rackunit)

(check-match
 1
 a
 (symbol? a))

(check-match
 `(1)
 `(,a)
 (symbol? a))

(check-match
  'a
  a
 (integer? a))

What should have happened?
The user should be able to debug the test failure from the error message.

If you got an error message, please include it here.

--------------------
; FAILURE
;   Source locations:
;   /tmp/meow.rkt:5:0
name:       check-match
location:   meow.rkt:5:0
actual:     1
expected:   'a
--------------------
--------------------
; FAILURE
;   Source locations:
;   /tmp/meow.rkt:10:0
name:       check-match
location:   meow.rkt:10:0
actual:     '(1)
expected:   '`(,a)
--------------------
--------------------
; FAILURE
;   Source locations:
;   /tmp/meow.rkt:16:0
name:       check-match
location:   meow.rkt:16:0
actual:     'a
expected:   'a
--------------------

Please include any other relevant details
The error messages we get out of check-match can often be extremely misleading. Consider the above examples, where tests fail apparently claiming that 'a is not equal to 'a (when the read problem is that 'a is not an integer), and that 'a was expected but 1 was produced (when the real problem is that 1 is not a symbol).

I might take a stab at fixing this later if others can't do it faster than me.

@capfredf
Copy link
Member

can someone who has permissions help transfer this issue to rackunit

@AlexKnauth AlexKnauth transferred this issue from racket/racket Feb 15, 2023
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