From 4146476e6fb7d07f13c29d3cc9ecf4addf2cbc99 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 27 Sep 2012 18:51:04 +1000 Subject: Utility to compare two article files to see if they produce the same results --- Compare.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Compare.hs (limited to 'Compare.hs') 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 -- cgit