diff options
Diffstat (limited to 'tests/stlc-ext.rkt')
-rw-r--r-- | tests/stlc-ext.rkt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/stlc-ext.rkt b/tests/stlc-ext.rkt new file mode 100644 index 0000000..ee39145 --- /dev/null +++ b/tests/stlc-ext.rkt @@ -0,0 +1,11 @@ +#lang racket +(require (except-in rackunit check)) +(require "../stlc-ext.rkt") + +(check-true (equiv-term '(λ a a) '(λ b b) #hash())) +(check-true (equiv-term '(λ a (λ b a)) '(λ b (λ a b)) #hash())) +(check-true (equiv-term '(λ a (λ b (λ c (a (b c))))) '(λ c (λ a (λ b (c (a b))))) #hash())) +(check-eq? (interpret '(if #t 1 0)) 1) +(check-eq? (interpret '(type Natural Nat ((λ (x : Natural) (inc x)) 1))) 2) +(check-eq? (infer '(type Natural Nat ((λ (x : Natural) (inc x)) 1))) 'Nat) +(check-true (check '(type Natural Nat ((λ (x : Natural) (inc x)) 1)) 'Nat)) |