Skip to content

Commit af5e3f2

Browse files
committed
fixing arithmetic tests
1 parent 5eafd6a commit af5e3f2

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

test/ArithmeticTests.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ import Debug.Trace
1515
import PrettyPrint
1616
import qualified System.IO.Strict as Strict
1717
import Telomare
18-
import Telomare.Eval (compileUnitTest, compileUnitTestNoAbort)
18+
import Telomare.Eval (SizingOption (..), compile, compileUnitTest,
19+
compileUnitTestNoAbort, runStaticChecks)
1920
import Telomare.Parser (AnnotatedUPT, TelomareParser, parseLongExpr,
2021
parsePrelude)
22+
import Telomare.PossibleData (CompiledExpr)
2123
import Telomare.Resolver (process)
2224
import Telomare.RunTime (simpleEval)
2325
import Test.Tasty
@@ -59,17 +61,15 @@ evalExprString input = do
5961
Left err -> pure $ Left (errorBundlePretty err)
6062
Right aupt -> do
6163
let term = DummyLoc :< LetUPF preludeBindings aupt
62-
compile' :: Term3 -> Either EvalError IExpr
63-
compile' x = case compileUnitTestNoAbort x of
64-
Left err -> Left err
65-
Right r -> case toTelomare r of
66-
Just te -> pure $ fromTelomare te
67-
Nothing -> Left . RTE . ResultConversionError $ "conversion error from compiled expr:\n" <> prettyPrint r
64+
compile' :: Term3 -> Either EvalError CompiledExpr
65+
compile' = compile NoSizing pure
6866
case first RE (process term) >>= compile' of
6967
Left err -> pure $ Left (show err)
7068
Right iexpr -> case eval iexpr of
7169
Left e -> pure . Left . show $ e
72-
Right result -> pure . Right . show . PrettyIExpr $ result
70+
Right result -> case toTelomare result of
71+
Just r -> pure . Right . show $ PrettyIExpr r
72+
Nothing -> pure . Left $ "conversion error from result:\n" <> prettyPrint result
7373

7474
assertExpr :: String -> String -> Assertion
7575
assertExpr input expected = do

0 commit comments

Comments
 (0)