Skip to content

RackUnit check-exn fails to catch raised syntax error when error not called directly #2996

@tommymchugh

Description

@tommymchugh

Example:

#lang racket
(require rackunit)

(check-exn
   exn:fail:syntax?
   (lambda ()
     (raise-syntax-error #f "Failed" #f #f null "")))

(check-exn
   exn:fail:syntax?
   (lambda ()
     (struct apple (seeds) #:constructor-name pear)
     (apple 53)))

First check passes, but second check never seems to catch that raise-syntax-error (and thus produces an exn:fail:syntax) is called when the identifier is called for a struct that has a different constructor name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions