git @ Cat's Eye Technologies PL-GOTO.NET / b5674b4
Convert tests to the proposed Falderal 0.3 format. catseye 8 years ago
2 changed file(s) with 9 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
22 Test Suite for PL-{GOTO}.NET
33 ============================
44
5 This test suite is written in the format of Falderal 0.2. It is far from
5 This test suite is written in the format of Falderal 0.3. It is far from
66 exhaustive, but provides a basic sanity check that the language we've
77 implemented comes close to PL-{GOTO}.
88
9 > module Tests where
10
11 > import qualified Test.Falderal.Runner as Runner
12 > import PLexceptGOTOdotNET
13
14 > test = Runner.run ["Tests.lhs"] [] [
15 > ("PL-{GOTO} Parsing", pa),
16 > ("PL-{GOTO} Evaluation", run),
17 > ("Loop Labeling", testLoopLabeling)
18 > ]
19
209 PL-{GOTO} Parsing
2110 -----------------
11
12 -> Tests for Haskell function PLexceptGOTOdotNET:pa
2213
2314 | n ← 0;
2415 = Block [AssignZero "n"]
4839
4940 PL-{GOTO} Evaluation
5041 --------------------
42
43 -> Tests for Haskell function PLexceptGOTOdotNET:run
5144
5245 | n ← 0;
5346 = [("n",0)]
8578 Loop Labeling
8679 -------------
8780
81 -> Tests for Haskell function PLexceptGOTOdotNET:testLoopLabeling
82
8883 | n ← 0; m ← 0; LOOP n;
8984 | LOOP m;
9085 | n ← 0;
11 if [ "${FALDERAL}x" = "x" ]; then
22 FALDERAL=../falderal/
33 fi
4 ghc -i$FALDERAL Tests.lhs -e test
4 ghc -i$FALDERAL $FALDERAL/Test/Falderal/Driver.hs -e 'format "haskell" "Tests.lhs"' > GeneratedFalderalTests.hs
5 ghc -i$FALDERAL GeneratedFalderalTests.hs -e testModule