~jojo/Carth

ref: 98ab37e59ce10d5f25d2a91dffb651a2452e9860 Carth/test/ParseSpec.hs -rw-r--r-- 351 bytes
98ab37e5 — Johan Johansson Wrap ident in newtype, parse defs, parse program 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE NumDecimals #-}

module ParseSpec where

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

import Ast
import Parse

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