tasty-discover
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
module Gyehoek.Test.CPS.Eval (root) where
|
||||
module Gyehoek.Test.CPS.Eval where
|
||||
|
||||
import Test.Tasty (TestTree, testGroup)
|
||||
import Test.Tasty.HUnit
|
||||
@@ -8,9 +8,8 @@ import Gyehoek.CPS.Eval qualified as Sut
|
||||
import Data.List (List)
|
||||
|
||||
|
||||
root :: IO TestTree
|
||||
root = pure . testGroup "cps interpreter" $
|
||||
[ prim
|
||||
test_cpsInterpreter = testGroup "cps interpreter" $
|
||||
[ primitives
|
||||
, testCase "halt with constant" do
|
||||
evalsTo [ObjImm (ImmInt 123)] [cps|
|
||||
(continue halt 123)
|
||||
@@ -39,7 +38,7 @@ root = pure . testGroup "cps interpreter" $
|
||||
evalsTo :: HasCallStack => List Obj -> Sut.Program -> Assertion
|
||||
evalsTo rs p = Sut.evalProgram p @?= rs
|
||||
|
||||
prim = testGroup "primitives"
|
||||
primitives = testGroup "primitives"
|
||||
[ testGroup "arith"
|
||||
[ testCase "basic 1" do
|
||||
evalsTo [ObjImm (ImmInt 20)] [cps|
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module Gyehoek.Test.CPS.Stackify (root) where
|
||||
module Gyehoek.Test.CPS.Stackify where
|
||||
|
||||
import Test.Tasty (TestTree, testGroup)
|
||||
import Test.Tasty.HUnit
|
||||
@@ -10,8 +10,7 @@ import Gyehoek.GenSym (runGenSym)
|
||||
import Effectful
|
||||
|
||||
|
||||
root :: IO TestTree
|
||||
root = pure . testGroup "stackify" $
|
||||
test_stackify =
|
||||
[ trivialReturn
|
||||
, tailCall
|
||||
, prim
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{-# LANGUAGE OverloadedLists #-}
|
||||
module Gyehoek.Test.CPS.Syntax (root) where
|
||||
module Gyehoek.Test.CPS.Syntax where
|
||||
|
||||
import Test.Tasty (TestTree, testGroup)
|
||||
import Test.Tasty.HUnit
|
||||
@@ -8,14 +8,13 @@ import Gyehoek.CPS.Syntax (cps)
|
||||
import Gyehoek.CPS.Syntax qualified as Sut
|
||||
|
||||
|
||||
root :: IO TestTree
|
||||
root = pure . testGroup "cps syntax" $
|
||||
[ qqTree
|
||||
, freeTree
|
||||
test_root = testGroup "cps syntax"
|
||||
[ free
|
||||
, qq
|
||||
]
|
||||
|
||||
freeTree :: TestTree
|
||||
freeTree = testGroup "free"
|
||||
free :: TestTree
|
||||
free = testGroup "free"
|
||||
[ testCase "lambda" do
|
||||
Sut.free' @Sut.Lambda [cps|
|
||||
(lambda (x y z k1) (continue k1 x a b c y))
|
||||
@@ -27,8 +26,8 @@ freeTree = testGroup "free"
|
||||
(continue x y k3))|] @=? ["k3"]
|
||||
]
|
||||
|
||||
qqTree :: TestTree
|
||||
qqTree = testGroup "parser"
|
||||
qq :: TestTree
|
||||
qq = testGroup "parser"
|
||||
[ testCase "lambda" do
|
||||
assertEqual "" (Sut.MkLambda ["x","y"] "ktail"
|
||||
(Sut.ExpContinue "ktail" [Sut.ValVar "x"]))
|
||||
|
||||
Reference in New Issue
Block a user