cli, cps interpreter, stack vm, closure-conversion, fixes, tests, LOL
build / build (push) Successful in 7m49s
build / build (push) Successful in 7m49s
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
module Gyehoek.Test.Scheme.Syntax (root) where
|
||||
|
||||
import Test.Tasty (TestTree, testGroup)
|
||||
import Test.Tasty.HUnit
|
||||
import Language.SexpGrammar ()
|
||||
import Gyehoek.Scheme.Syntax (scm)
|
||||
import Gyehoek.Scheme.Syntax qualified as Sut
|
||||
|
||||
|
||||
root :: IO TestTree
|
||||
root = pure . testGroup "scheme syntax" $
|
||||
[ freeTree
|
||||
]
|
||||
|
||||
freeTree :: TestTree
|
||||
freeTree = testGroup "free"
|
||||
[ testCase "lambda" do
|
||||
Sut.free' [scm|
|
||||
(lambda (x y z k) (f x b a))
|
||||
|] @=? ["f","b","a"]
|
||||
, testCase "exp" do
|
||||
Sut.free' [scm|
|
||||
(letrec ((x (lambda (r) (f a y)))
|
||||
(y (lambda (r b) (f b x))))
|
||||
(g x y z))
|
||||
|] @=? ["f","a","g","z"]
|
||||
]
|
||||
Reference in New Issue
Block a user