From c34f0bf66bfab7a7ac0c90e8b9466507a68ca03b Mon Sep 17 00:00:00 2001 From: bananu7 Date: Wed, 26 Apr 2017 20:53:01 +0200 Subject: [PATCH] Added the string parsing test with shouldSatisfy to ignore SourcePos --- Test/Test.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Test/Test.hs b/Test/Test.hs index a895828..41f97c1 100644 --- a/Test/Test.hs +++ b/Test/Test.hs @@ -18,9 +18,8 @@ spec = do it "should parse floats" $ parse "return 4.2" `shouldBe` Block [Return [Number 4.2]] it "should parse negative numbers" $ do parse "return -3" `shouldBe` Block [Return [UnOp "-" (Number 3.0)]] - parse "return -2.9" `shouldBe` Block [Return [UnOp "-" (Number 2.9)]] - -- this one can't be easily done because of the SourcePos - --it "should parse strings" $ parse "\"test\"" `shouldBe` [StringLiteral 0 "test"] + parse "return -2.9" `shouldBe` Block [Return [UnOp "-" (Number 2.9)]] + it "should parse strings" $ parse "return \"test\"" `shouldSatisfy` (\(Block [Return [StringLiteral _ s]]) -> s == "test") describe "should parse simple assignments" $ do it "a number to a variable" $