@@ -21,70 +21,70 @@ main = do
2121 hspec $ describe " src/Parser.hs" $ do
2222
2323 it " Atom" $
24- readExpr " bb-8?" `shouldBe` ( Right $ Atom " bb-8?" )
24+ readExpr " bb-8?" `shouldBe` Right ( Atom " bb-8?" )
2525
2626 it " Num Negative" $
27- readExpr " -2187" `shouldBe` ( Right $ Number (- 2187 ))
27+ readExpr " -2187" `shouldBe` Right ( Number (- 2187 ))
2828
2929 it " Num Positive" $
30- readExpr " 112233" `shouldBe` ( Right $ Number 112233 )
30+ readExpr " 112233" `shouldBe` Right ( Number 112233 )
3131
3232 it " Num Positive with Sign" $
33- readExpr " +12345" `shouldBe` ( Right $ Number 12345 )
33+ readExpr " +12345" `shouldBe` Right ( Number 12345 )
3434
3535 it " String" $
36- readExpr " \" Gen L Organa\" " `shouldBe` ( Right $ String " Gen L Organa" )
36+ readExpr " \" Gen L Organa\" " `shouldBe` Right ( String " Gen L Organa" )
3737
3838 it " Bool True" $
39- readExpr " #t" `shouldBe` ( Right $ Bool True )
39+ readExpr " #t" `shouldBe` Right ( Bool True )
4040
4141 it " Bool False" $
42- readExpr " #f" `shouldBe` ( Right $ Bool False )
42+ readExpr " #f" `shouldBe` Right ( Bool False )
4343
4444 it " Nil" $
45- readExpr " '()" `shouldBe` ( Right $ Nil )
45+ readExpr " '()" `shouldBe` Right Nil
4646
4747 it " S-Expr: homogenous list" $
4848 readExpr " (2 1 87)" `shouldBe`
49- ( Right $ List [Number 2 , Number 1 ,Number 87 ])
49+ Right ( List [Number 2 , Number 1 ,Number 87 ])
5050
5151 it " S-Expr: homogenous list quoted" $
5252 readExpr " '(2 1 87)" `shouldBe`
53- ( Right $ List [Atom " quote" ,List [Number 2 , Number 1 ,Number 87 ]])
53+ Right ( List [Atom " quote" ,List [Number 2 , Number 1 ,Number 87 ]])
5454
5555 it " S-Expr: heterogenous list" $
5656 readExpr " (stromTrooper \" Fn\" 2 1 87)" `shouldBe`
57- ( Right $ List [Atom " stromTrooper" , String " Fn" , Number 2 , Number 1 ,Number 87 ])
57+ Right ( List [Atom " stromTrooper" , String " Fn" , Number 2 , Number 1 ,Number 87 ])
5858
5959 it " S-Expr: heterogenous list quoted" $
6060 readExpr " '(stromTrooper \" Fn\" 2 1 87)" `shouldBe`
61- ( Right $ List [Atom " quote" , List [Atom " stromTrooper" , String " Fn" , Number 2 , Number 1 ,Number 87 ]])
61+ Right ( List [Atom " quote" , List [Atom " stromTrooper" , String " Fn" , Number 2 , Number 1 ,Number 87 ]])
6262
6363 it " S-Expr: single negative" $
64- readExpr " (-42)" `shouldBe` ( Right $ List [Number (- 42 )])
64+ readExpr " (-42)" `shouldBe` Right ( List [Number (- 42 )])
6565
6666 it " S-Expr: (- num)" $
67- readExpr " (- 42)" `shouldBe` ( Right $ List [Atom " -" , Number 42 ])
67+ readExpr " (- 42)" `shouldBe` Right ( List [Atom " -" , Number 42 ])
6868
6969 it " S-Expr: prim call: numbers" $
7070 readExpr " (+ 1 2)" `shouldBe`
71- ( Right $ List [Atom " +" , Number 1 , Number 2 ])
71+ Right ( List [Atom " +" , Number 1 , Number 2 ])
7272
7373 it " S-Expr: prim call: neg nums" $
7474 readExpr " (- -42 -42)" `shouldBe`
75- ( Right $ List [Atom " -" , Number (- 42 ), Number (- 42 )])
75+ Right ( List [Atom " -" , Number (- 42 ), Number (- 42 )])
7676
7777 it " S-Expr: prim call: atoms" $
7878 readExpr " (- rogue squadron)" `shouldBe`
79- ( Right $ List [Atom " -" , Atom " rogue" , Atom " squadron" ])
79+ Right ( List [Atom " -" , Atom " rogue" , Atom " squadron" ])
8080
8181 it " S-Expr: nested list" $
8282 readExpr " (lambda (x x) (+ x x))" `shouldBe`
83- ( Right $ List [Atom " lambda" , List [Atom " x" , Atom " x" ], List [Atom " +" , Atom " x" , Atom " x" ]])
83+ Right ( List [Atom " lambda" , List [Atom " x" , Atom " x" ], List [Atom " +" , Atom " x" , Atom " x" ]])
8484 it " Comment: end-of/single line" $
85- readExpr " ;skip\n artoodetoo ;extra will throw\n ;skip" `shouldBe` ( Right $ Atom " artoodetoo" )
85+ readExpr " ;skip\n artoodetoo ;extra will throw\n ;skip" `shouldBe` Right ( Atom " artoodetoo" )
8686 it " Comment: multi-line line" $
87- readExpr " {-Han\n Shot\n First\n -} (c3 {- these are not the droids you're looking for-} po)\n {-Jar Jar Binks =?= Sith Lord -}" `shouldBe` ( Right $ List [Atom " c3" ,Atom " po" ])
87+ readExpr " {-Han\n Shot\n First\n -} (c3 {- these are not the droids you're looking for-} po)\n {-Jar Jar Binks =?= Sith Lord -}" `shouldBe` Right ( List [Atom " c3" ,Atom " po" ])
8888
8989 hspec $ describe " src/Eval.hs" $ do
9090 wStd " test/add.scm" $ Number 3
@@ -126,7 +126,7 @@ wStd = runExpr (Just "test/stdlib_mod.scm")
126126tExpr :: T. Text -> T. Text -> LispVal -> SpecWith ()
127127tExpr note expr val =
128128 it (T. unpack note) $ evalVal `shouldBe` val
129- where evalVal = ( unsafePerformIO $ runASTinEnv basicEnv $ fileToEvalForm " " expr)
129+ where evalVal = unsafePerformIO $ runASTinEnv basicEnv $ fileToEvalForm " " expr
130130
131131
132132runExpr :: Maybe T. Text -> T. Text -> LispVal -> SpecWith ()
0 commit comments