~jojo/Carth

ref: 3438b5bedc247fdc2a2ab5b4edc896251a1267df Carth/test/ParseSpec.hs -rw-r--r-- 444 bytes
3438b5beJoJo Change spec of what to do when "closing" a todo 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE NumDecimals #-}

module ParseSpec where

import Text.Parsec hiding (parse)
import Test.Hspec
import Test.QuickCheck

import Misc
import Ast
import Parse

spec :: Spec
spec = do
    describe "parse inverse of pretty"
        $ it
              "Parsing a pretty printed program should return the original program"
        $ withMaxSuccess
              5e4
              (\progAst -> parse "spec" (pretty progAst) == Right progAst)