summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test/Minilang/Lambda
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-11-02 18:18:50 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-11-02 18:18:50 +0100
commitd8e4ef2a4611682e273ca18189b1bebf791a1bb8 (patch)
tree64f95ac3e30a6a2a7898da300f982257202f4393 /lambda-calcul/haskell/test/Minilang/Lambda
parent00ef8caacaa576b4045d43a5bdddd81a2d093496 (diff)
downloadlambda-nantes-d8e4ef2a4611682e273ca18189b1bebf791a1bb8.tar.gz
fix tests and add HTML stuff to deployment
Diffstat (limited to 'lambda-calcul/haskell/test/Minilang/Lambda')
-rw-r--r--lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs22
1 files changed, 19 insertions, 3 deletions
diff --git a/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs b/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs
index c6d64c7..f79053c 100644
--- a/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs
+++ b/lambda-calcul/haskell/test/Minilang/Lambda/ParserSpec.hs
@@ -4,15 +4,31 @@
module Minilang.Lambda.ParserSpec where
+import Data.Either (isRight)
import Data.Function ((&))
import Data.Text (Text, pack)
import qualified Data.Text as Text
import Minilang.Lambda.Eval (Term (Lam))
import qualified Minilang.Lambda.Eval as Eval
import Minilang.Lambda.Parser (AST (..), desugar, initialChars, parse, pretty, restChars)
-import Test.Hspec (Spec, parallel, shouldBe)
+import Test.Hspec (Spec, parallel, shouldBe, shouldSatisfy)
import Test.Hspec.QuickCheck (prop)
-import Test.QuickCheck (Arbitrary (..), Gen, NonEmptyList (..), counterexample, elements, forAll, forAllShrink, listOf, oneof, resize, sized, vectorOf, (===), (==>))
+import Test.QuickCheck
+ ( Arbitrary (..),
+ Gen,
+ NonEmptyList (..),
+ counterexample,
+ elements,
+ forAll,
+ forAllShrink,
+ listOf,
+ oneof,
+ resize,
+ sized,
+ vectorOf,
+ (===),
+ (==>),
+ )
-- ((f x) y) --> (f x y)
-- (lam (x) (lam (y) y)) --> (lam (x y) y)
@@ -79,7 +95,7 @@ spec = parallel $ do
<> pretty body
<> ")"
)
- `shouldBe` Right app
+ `shouldSatisfy` isRight
spine :: AST -> Int
spine = \case