diff options
Diffstat (limited to 'lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs')
| -rw-r--r-- | lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs b/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs index 40866bb..0050973 100644 --- a/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs +++ b/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs @@ -8,10 +8,9 @@ import Data.Either (isLeft, isRight) import Data.Function ((&)) import Data.Text (Text, pack) import qualified Data.Text as Text -import Minilang.Lambda.Eval (Term (Lam)) +import Minilang.Lambda.Eval (Term (Lam), normalise) import qualified Minilang.Lambda.Eval as Eval -import Minilang.Lambda.Parser (AST (..), desugar, initialChars, parse, parseProgram, pretty, restChars, escapeString) -import Minilang.Lambda.Eval (normalise) +import Minilang.Lambda.Parser (AST (..), desugar, escapeString, initialChars, parse, parseProgram, pretty, restChars) import Test.Hspec (Spec, describe, it, parallel, shouldBe, shouldSatisfy) import Test.Hspec.QuickCheck (prop) import Test.QuickCheck ( @@ -91,13 +90,13 @@ spec = parallel $ do <> Text.concat ( map ( \(Identifier v, t) -> - "(" <> v <> " " <> pretty t <> ")" + "(" <> v <> " " <> pretty t <> ")\n" ) bound ) - <> ") " + <> ")\n " <> pretty body - <> ")" + <> ")\n" ) `shouldSatisfy` isRight @@ -370,8 +369,8 @@ genAst depth = -- logic is tested separately. genStrLit :: Gen AST genStrLit = StrLit . pack <$> listOf (elements safeChars) - where - safeChars = filter (\c -> c /= '"' && c /= '\\') [' '..'~'] + where + safeChars = filter (\c -> c /= '"' && c /= '\\') [' ' .. '~'] genDef :: Int -> Gen AST genDef n = Def . unIdent <$> arbitrary <*> genAst n |
