www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

general-tests.rkt (1359B)


      1 #lang racket
      2 
      3 (module+ test
      4   (require "../../typecheck.rkt"
      5            "rackunit-typechecking.rkt")
      6 
      7   ;; check ordering of type constructor args
      8   (check-stx-err
      9    (define-type-constructor #:a)
     10    #:with-msg "expected identifier")
     11   (check-stx-err
     12    (define-type-constructor name #:a)
     13    #:with-msg "expected one of these literals")
     14   
     15   (define-type-constructor -> #:arity > 0)
     16   (define-binding-type mu #:arity = 1 #:bvs = 1)
     17   (define-binding-type forall #:bvs = 1 #:arity = 1)
     18   (define-binding-type exist #:arr void #:bvs = 1 #:arity = 1)
     19   (define-binding-type exist2 #:bvs = 1 #:arity = 1 #:arr void)
     20   (define-binding-type exist3 #:bvs = 1 #:arr void #:arity = 1)
     21   
     22   (check-stx-err
     23    (define-binding-type exist4 #:bvs = 1 #:no-attach- #:arity = 1)
     24    #:with-msg "expected one of these literals")
     25   
     26   (define-type-constructor exist5)
     27   (define-binding-type exist7)
     28  
     29 
     30   (check-stx-err
     31    (define-binding-type exist6 #:bvs 1)
     32    #:with-msg "expected more terms")
     33   (check-stx-err
     34    (define-binding-type exist6 #:bvs = 1 #:bvs = 1)
     35    #:with-msg "too many occurrences of #:bvs keyword")
     36   (check-stx-err
     37    (define-binding-type exist6 #:arity = 1 #:arity = 1)
     38    #:with-msg "too many occurrences of #:arity keyword")
     39   (check-stx-err
     40    (define-binding-type exist6 #:arr void #:arr void)
     41    #:with-msg "too many occurrences of #:arr keyword")
     42 )