@@ -15,9 +15,11 @@ import Debug.Trace
1515import PrettyPrint
1616import qualified System.IO.Strict as Strict
1717import Telomare
18- import Telomare.Eval (compileUnitTest , compileUnitTestNoAbort )
18+ import Telomare.Eval (SizingOption (.. ), compile , compileUnitTest ,
19+ compileUnitTestNoAbort , runStaticChecks )
1920import Telomare.Parser (AnnotatedUPT , TelomareParser , parseLongExpr ,
2021 parsePrelude )
22+ import Telomare.PossibleData (CompiledExpr )
2123import Telomare.Resolver (process )
2224import Telomare.RunTime (simpleEval )
2325import 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
7474assertExpr :: String -> String -> Assertion
7575assertExpr input expected = do
0 commit comments