Commit 14635776 authored by Michael Hanus 's avatar Michael Hanus
Browse files

AbstractCurry test added

parent dc6e165e
......@@ -18,7 +18,7 @@ BACKEND=`$CURRYBIN/curry :set v0 :set -time :load Distribution :eval "putStrLn (
TESTLANG="testFunctional testInfinite testHigher testNarr testNondet testCase testFCase testLetRec testRecords testNonLinearPattern testNonStrictUnif testFuncPattern testAsPattern"
# test for standard libraries
TESTLIBS="testPrelude testCombinatorial testDatabase testDirectory testDynamic testFlatCurryGoodies testFlatCurryXML testGlobal testGlobalVariable testInteger testIOExts testList testSetFunctions testSort testSystem testTraversal testArray testDequeue testFiniteMap testRedBlackTree testFormat testRegExp"
TESTLIBS="testPrelude testAbstractCurry testCombinatorial testDatabase testDirectory testDynamic testFlatCurryGoodies testFlatCurryXML testGlobal testGlobalVariable testInteger testIOExts testList testSetFunctions testSort testSystem testTraversal testArray testDequeue testFiniteMap testRedBlackTree testFormat testRegExp"
# additional library tests for PAKCS with various Prolog back ends:
TESTLIBSBACKEND=
......
------------------------------------------------------------------------------
--- Some tests for AbstractCurry libraries.
---
--- To run all tests automatically by the currytest tool, use the command:
--- "currytest testAbstractCurry"
---
--- @author Michael Hanus
--- @version September 2015
------------------------------------------------------------------------------
import AbstractCurry.Files
import AbstractCurry.Pretty
import Directory
import FlatCurry
import Assertion
--- Test for equality of a FlatCurry program with the same program
--- after pretty printing the AbstractCurry program:
readAndTestEqualFcy mod = do
prog1 <- readFlatCurry mod
let modcurry = mod ++ ".curry"
modbak = mod ++ ".BAK"
renameFile modcurry modbak
copyFile modbak modcurry
let modpp = mod ++ ".PP"
readCurry mod >>= writeFile modpp . showCProg
removeFile modcurry
renameFile modpp modcurry
prog2 <- readFlatCurry mod
removeFile modcurry
renameFile modbak modcurry
return (prog1 == prog2)
test1 = assertIO "AbstractCurry.Pretty test for rev"
(readAndTestEqualFcy "rev") True
test2 = assertIO "AbstractCurry.Pretty test for testFuncPattern"
(readAndTestEqualFcy "testFuncPattern") True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment