Add a test suite for the syntax collect.
This commit is contained in:
parent
b25ee81d79
commit
669523477a
18
collects/tests/syntax/run.rkt
Normal file
18
collects/tests/syntax/run.rkt
Normal file
|
@ -0,0 +1,18 @@
|
|||
#lang racket/base
|
||||
|
||||
(require rackunit rackunit/text-ui racket/runtime-path)
|
||||
|
||||
;; Runs all the files in the tests subdirectory.
|
||||
;; A test fails if it throws an exception.
|
||||
|
||||
(define-runtime-path tests-dir "./tests")
|
||||
|
||||
(define tests
|
||||
(make-test-suite
|
||||
"syntax tests"
|
||||
(for/list ([t (in-directory tests-dir)])
|
||||
(test-suite
|
||||
(path->string t)
|
||||
(check-not-exn (lambda () (dynamic-require t #f)))))))
|
||||
|
||||
(run-tests tests)
|
20
collects/tests/syntax/tests/pr12017.rkt
Normal file
20
collects/tests/syntax/tests/pr12017.rkt
Normal file
|
@ -0,0 +1,20 @@
|
|||
#lang racket
|
||||
(require (for-syntax racket/struct-info racket/match))
|
||||
|
||||
(define-signature sig2^
|
||||
((struct my-error (v))))
|
||||
|
||||
|
||||
(define-unit a-unit@
|
||||
(import)
|
||||
(export sig2^)
|
||||
(define-struct my-error (v)))
|
||||
|
||||
(define-values/invoke-unit/infer a-unit@)
|
||||
|
||||
(begin-for-syntax
|
||||
struct-info?
|
||||
(match (extract-struct-info (syntax-local-value #'my-error))
|
||||
[(list str m1 m? sels sets _)
|
||||
(unless (= (length sels) (length sets))
|
||||
(error "not the same number of selectors and setters"))]))
|
Loading…
Reference in New Issue
Block a user