racket / rackunit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

check-exn and check-not-exn use different check-info names

bennn opened this issue · comments

  • check-exn uses the names exn and exn-message
  • check-not-exn uses the names exception and exception-message

I think both should use exception and exception-message


Example: here's 2 failing checks:

#lang racket/base
(require rackunit)

(define (die) (raise-user-error 'die))

(check-exn exn:fail:contract? die)
(check-not-exn die)

And their output:

raco test: "foo.rkt"
--------------------
FAILURE
name:         check-exn
location:     foo.rkt:6:0
params:       '(#<procedure:exn:fail:contract?> #<procedure:die>)
message:      "Wrong exception raised"
exn-message:  "error: die"
exn:          #(struct:exn:fail:user "error: die" #<continuation-mark-set>)
--------------------
--------------------
FAILURE
name:               check-not-exn
location:           foo.rkt:7:0
params:             '(#<procedure:die>)
message:            "Exception raised"
exception-message:  "error: die"
exception:          #(struct:exn:fail:user "error: die" #<continuation-mark-set>)
--------------------
2/2 test failures