From 6a5acf36e6764c47da526f2980edfef42ae6f59a Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Wed, 19 Mar 2014 11:16:00 +1100 Subject: More concise test case statements --- Fractran/Test.hs | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'Fractran') diff --git a/Fractran/Test.hs b/Fractran/Test.hs index 80f5424..2b507b1 100644 --- a/Fractran/Test.hs +++ b/Fractran/Test.hs @@ -17,39 +17,23 @@ instance Eq Text.Parsec.Error.ParseError -parser0 = TestCase (assertEqual "" - (Right (FractranProgram [] 2)) - (parseFractran "2")) +parser0 = (Right (FractranProgram [] 2)) ~=? (parseFractran "2") -parser1 = TestCase (assertEqual "" - (Right (FractranProgram [] 2)) - (parseFractran "2\n")) +parser1 = (Right (FractranProgram [] 2)) ~=? (parseFractran "2\n") -parser2 = TestCase (assertEqual "" - (Right (FractranProgram [] 2)) - (parseFractran "\n2")) +parser2 = (Right (FractranProgram [] 2)) ~=? (parseFractran "\n2") -parser3 = TestCase (assertEqual "" - (Right (FractranProgram [(1,2)] 2)) - (parseFractran "2 1/2")) +parser3 = (Right (FractranProgram [(1,2)] 2)) ~=? (parseFractran "2 1/2") -parser4 = TestCase (assertEqual "" - (Right (FractranProgram [(2,3)] 3)) - (parseFractran "3\n \n2/3\n")) +parser4 = (Right (FractranProgram [(2,3)] 3)) ~=? (parseFractran "3\n \n2/3\n") -interpreter0 = TestCase (assertEqual "" - [108,162,243] - (fractran (FractranProgram addition 108))) +interpreter0 = [108,162,243] ~=? (fractran (FractranProgram addition 108)) -interpreter1 = TestCase (assertEqual "" - [2,15,825,725,1925,2275,425,390,330,290,770,910,170,156,132,116,308,364,68,4] - (take 20 (fractran prime2))) +interpreter1 = [2,15,825,725,1925,2275,425,390,330,290,770,910,170,156,132,116,308,364,68,4] ~=? (take 20 (fractran prime2)) -interpreter2 = TestCase (assertEqual "" - [5] - (fractran (FractranProgram addition 5))) +interpreter2 = [5] ~=? (fractran (FractranProgram addition 5)) -- cgit