diff options
| author | Arnaud Bailly <arnaud@pankzsoft.com> | 2026-03-21 09:06:47 +0100 |
|---|---|---|
| committer | Arnaud Bailly <arnaud@pankzsoft.com> | 2026-03-21 09:06:47 +0100 |
| commit | fade9c496cebbc0caa97821cb85e9e56da31c57f (patch) | |
| tree | 7dd30194f57fad64de18584c08385e0e7107eb68 /lambda-calcul/haskell/src/Minilang/App.hs | |
| parent | cbc3ebfca24c89c475b9970fa525055d8291ee88 (diff) | |
| download | lambda-nantes-fade9c496cebbc0caa97821cb85e9e56da31c57f.tar.gz | |
Add more challenges and plans for enhancement of the interpreter
Diffstat (limited to 'lambda-calcul/haskell/src/Minilang/App.hs')
| -rw-r--r-- | lambda-calcul/haskell/src/Minilang/App.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lambda-calcul/haskell/src/Minilang/App.hs b/lambda-calcul/haskell/src/Minilang/App.hs index 915f264..cce48f7 100644 --- a/lambda-calcul/haskell/src/Minilang/App.hs +++ b/lambda-calcul/haskell/src/Minilang/App.hs @@ -151,11 +151,11 @@ postAnswer (Just token) expected = do result = evaluateOutputs outputs expected updateUserLastTest token result case result of - TestSucceeded -> do + TestSucceeded -> upgradeUserChallenge token TestFailed msg -> liftIO $ throwM $ err400 {errBody = "Test failed: " <> LBS.fromStrict (encodeUtf8 msg)} - TestErrored msg -> do + TestErrored msg -> liftIO $ throwM $ err500 {errBody = "Error evaluating answer: " <> LBS.fromStrict (encodeUtf8 msg)} data TestResult = TestSucceeded | TestFailed Text | TestErrored Text @@ -167,7 +167,7 @@ isSuccess _ = False evaluateOutputs :: [Out] -> Text -> TestResult evaluateOutputs outputs expected = case outputs of - [Bye, Evaluated ast _ _] -> do + [Bye, Evaluated ast _ _] -> if pretty ast /= expected then TestFailed "Incorrect result" else TestSucceeded |
