Anonymous avatar Anonymous committed ec4aec3

Modernize test suite.

Comments (0)

Files changed (3)

PLexceptGOTOdotNET.falderal

-encoding: UTF-8
-
-Test Suite for PL-{GOTO}.NET
-============================
-
-This test suite is written in the format of Falderal 0.3.  It is far from
-exhaustive, but provides a basic sanity check that the language we've
-implemented comes close to PL-{GOTO}.
-
-PL-{GOTO} Parsing
------------------
-
--> Tests for Haskell function PLexceptGOTOdotNET:pa
-
-| n ← 0;
-= Block [AssignZero "n"]
-
-| n ← m;
-= Block [AssignOther "n" "m"]
-
-| n ← n + 1;
-= Block [AssignIncr "n" "n"]
-
-| n ← 0; LOOP n; m ← n; END;
-= Block [AssignZero "n",Loop 0 "n" (Block [AssignOther "m" "n"])]
-
-| n ← 0; m ← 0;
-| LOOP n;
-|     m ← n + 1;
-| END;
-= Block [AssignZero "n",AssignZero "m",Loop 0 "n" (Block [AssignIncr "m" "n"])]
-
-It's perfectly valid to have variables called LOOP and END.
-
-| LOOP ← 0; LOOP LOOP; LOOP ← LOOP + 1; END;
-= Block [AssignZero "LOOP",Loop 0 "LOOP" (Block [AssignIncr "LOOP" "LOOP"])]
-
-| END ← 0; LOOP END; END ← END + 1; END;
-= Block [AssignZero "END",Loop 0 "END" (Block [AssignIncr "END" "END"])]
-
-PL-{GOTO} Evaluation
---------------------
-
--> Tests for Haskell function PLexceptGOTOdotNET:run
-
-| n ← 0;
-= [("n",0)]
-
-| n ← 0; LOOP n; m ← n; END;
-= [("n",0)]
-
-| n ← 0; n ← n + 1; LOOP n; m ← n; END;
-= [("m",1),("n",1)]
-
-| m ← 0; n ← 0; n ← n + 1; n ← n + 1; LOOP n; m ← m + 1; END;
-= [("m",2),("n",2)]
-
-| n ← 0; n ← n + 1; n ← n + 1; n ← n + 1; n ← n + 1;
-| m ← 0; k ← 0;
-| LOOP n;
-|     m ← m + 1;
-|     LOOP m;
-|         k ← k + 1;
-|     END;
-| END;
-= [("k",10),("m",4),("n",4)]
-
-Changing the value of a loop variable inside the loop does not change
-the number of times the loop executes.
-
-| n ← 0; n ← n + 1; n ← n + 1; n ← n + 1; n ← n + 1;
-| m ← 0;
-| LOOP n;
-|     n ← 0; n ← n + 1;
-|     m ← m + 1;
-| END;
-= [("m",4),("n",1)]
-
-Loop Labeling
--------------
-
--> Tests for Haskell function PLexceptGOTOdotNET:testLoopLabeling
-
-| n ← 0; m ← 0; LOOP n;
-|     LOOP m;
-|         n ← 0; 
-|     END;
-| END;
-= (Block [AssignZero "n",AssignZero "m",Loop 1 "n" (Block [Loop 0 "m" (Block [AssignZero "n"])])],2)

PLexceptGOTOdotNET.markdown

+Test Suite for PL-{GOTO}.NET
+============================
+
+This test suite is written in the format of Falderal 0.7.  It is far from
+exhaustive, but provides a basic sanity check that the language we've
+implemented comes close to PL-{GOTO}.
+
+PL-{GOTO} Parsing
+-----------------
+
+    -> Tests for functionality "Parse PL-{GOTO} Program"
+
+    -> Functionality "Parse PL-{GOTO} Program" is implemented by
+    -> shell command
+    -> "ghc -e "do c <- readFile \"%(test-file)\"; putStrLn $ PLexceptGOTOdotNET.pa c" PLexceptGOTOdotNET.lhs"
+
+    | n ← 0;
+    = Block [AssignZero "n"]
+
+    | n ← m;
+    = Block [AssignOther "n" "m"]
+
+    | n ← n + 1;
+    = Block [AssignIncr "n" "n"]
+
+    | n ← 0; LOOP n; m ← n; END;
+    = Block [AssignZero "n",Loop 0 "n" (Block [AssignOther "m" "n"])]
+
+    | n ← 0; m ← 0;
+    | LOOP n;
+    |     m ← n + 1;
+    | END;
+    = Block [AssignZero "n",AssignZero "m",Loop 0 "n" (Block [AssignIncr "m" "n"])]
+
+It's perfectly valid to have variables called LOOP and END.
+
+    | LOOP ← 0; LOOP LOOP; LOOP ← LOOP + 1; END;
+    = Block [AssignZero "LOOP",Loop 0 "LOOP" (Block [AssignIncr "LOOP" "LOOP"])]
+
+    | END ← 0; LOOP END; END ← END + 1; END;
+    = Block [AssignZero "END",Loop 0 "END" (Block [AssignIncr "END" "END"])]
+
+PL-{GOTO} Evaluation
+--------------------
+
+    -> Tests for functionality "Evaluate PL-{GOTO} Program"
+
+    -> Functionality "Evaluate PL-{GOTO} Program" is implemented by
+    -> shell command
+    -> "ghc -e "do c <- readFile \"%(test-file)\"; putStrLn $ PLexceptGOTOdotNET.run c" PLexceptGOTOdotNET.lhs"
+
+    | n ← 0;
+    = [("n",0)]
+
+    | n ← 0; LOOP n; m ← n; END;
+    = [("n",0)]
+
+    | n ← 0; n ← n + 1; LOOP n; m ← n; END;
+    = [("m",1),("n",1)]
+
+    | m ← 0; n ← 0; n ← n + 1; n ← n + 1; LOOP n; m ← m + 1; END;
+    = [("m",2),("n",2)]
+
+    | n ← 0; n ← n + 1; n ← n + 1; n ← n + 1; n ← n + 1;
+    | m ← 0; k ← 0;
+    | LOOP n;
+    |     m ← m + 1;
+    |     LOOP m;
+    |         k ← k + 1;
+    |     END;
+    | END;
+    = [("k",10),("m",4),("n",4)]
+
+Changing the value of a loop variable inside the loop does not change
+the number of times the loop executes.
+
+    | n ← 0; n ← n + 1; n ← n + 1; n ← n + 1; n ← n + 1;
+    | m ← 0;
+    | LOOP n;
+    |     n ← 0; n ← n + 1;
+    |     m ← m + 1;
+    | END;
+    = [("m",4),("n",1)]
+
+Loop Labeling
+-------------
+
+    -> Tests for functionality "Label PL-{GOTO} Loops"
+
+    -> Functionality "Label PL-{GOTO} Loops" is implemented by
+    -> shell command
+    -> "ghc -e "do c <- readFile \"%(test-file)\"; putStrLn $ PLexceptGOTOdotNET.testLoopLabeling c" PLexceptGOTOdotNET.lhs"
+
+    | n ← 0; m ← 0; LOOP n;
+    |     LOOP m;
+    |         n ← 0; 
+    |     END;
+    | END;
+    = (Block [AssignZero "n",AssignZero "m",Loop 1 "n" (Block [Loop 0 "m" (Block [AssignZero "n"])])],2)
 #!/bin/sh
 
-# This assumes Falderal 0.4 is installed.  The easiest way to do this
-# currently is to install it as a local Cabal package:
-#   $ hg clone https://bitbucket.org/catseye/falderal
-#   $ cd falderal
-#   $ ./install.sh
-
-falderal test PLexceptGOTOdotNET.falderal
+falderal test PLexceptGOTOdotNET.markdown
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.