summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-09-27 18:51:04 +1000
committerJed Barber <jjbarber@y7mail.com>2012-09-27 18:51:04 +1000
commit4146476e6fb7d07f13c29d3cc9ecf4addf2cbc99 (patch)
tree269bb9aca365ca89aa32a5eed1a00d152e24b91c
parentad1b2ed1e8fb4ec549318a27b5f80d2a6651b2dd (diff)
Utility to compare two article files to see if they produce the same results
-rw-r--r--Compare.hs18
-rw-r--r--makefile6
2 files changed, 23 insertions, 1 deletions
diff --git a/Compare.hs b/Compare.hs
new file mode 100644
index 0000000..4d9ab6d
--- /dev/null
+++ b/Compare.hs
@@ -0,0 +1,18 @@
+import System.Environment( getArgs )
+import Text.Printf
+import Library.Parse
+import Library.Semantic
+import Library.Stack
+
+
+
+main = do
+ args <- getArgs
+ listA <- getLines (args!!0)
+ listB <- getLines (args!!1)
+ let resultA = eval (map (stripReturn) listA)
+ resultB = eval (map (stripReturn) listB)
+ output = if (resultA == resultB)
+ then "Articles identical\n"
+ else "Differences detected\n"
+ printf output
diff --git a/makefile b/makefile
index d04dd06..07bca57 100644
--- a/makefile
+++ b/makefile
@@ -3,7 +3,7 @@ OUTPUTDIR = ./bin
-all: semantic syntactic proofgraph writeproof delete concat listthm meaningsubst unittest
+all: semantic syntactic proofgraph writeproof delete concat listthm meaningsubst unittest compare
clean:
find . -name '*.hi' -delete
@@ -36,3 +36,7 @@ meaningsubst:
unittest:
ghc --make ./Test.hs -o ${OUTPUTDIR}/UnitTest
+
+compare:
+ ghc --make ./Compare.hs -o ${OUTPUTDIR}/Compare
+