~jojo/Carth

ref: a7f643b031bbf8856a016a5f7b8d279a7f8407b4 Carth/test/ParseSpec.hs -rw-r--r-- 348 bytes
a7f643b0 — Johan Johansson nil -> unit 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE NumDecimals #-}

module ParseSpec where

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

import Ast
import Parse

spec :: Spec
spec = describe "parse" $ do
  it "parses a program to an AST, and is the inverse of pretty"
     (withMaxSuccess 1e3 (\progAst -> parse "spec" (pretty progAst) == Right progAst))