From 95506cb97c5834e9c52f1d3cdddc3c74d6b896f4 Mon Sep 17 00:00:00 2001 From: Nitin Prakash Date: Mon, 15 Jul 2024 09:59:09 +0530 Subject: [PATCH] bounds + unit tests --- swarm.cabal | 2 +- test/unit/TestEval.hs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/swarm.cabal b/swarm.cabal index fc64f2591..c73a37d2a 100644 --- a/swarm.cabal +++ b/swarm.cabal @@ -191,7 +191,7 @@ library swarm-lang terminal-size >=0.3 && <1.0, text, text-rope >=0.2 && <0.3, - unicode-show, + unicode-show >= 0.1 && <0.2, vector, vty, witch, diff --git a/test/unit/TestEval.hs b/test/unit/TestEval.hs index 09f6affac..37cc7ee61 100644 --- a/test/unit/TestEval.hs +++ b/test/unit/TestEval.hs @@ -227,6 +227,9 @@ testEval g = , testCase "format function" ("format (\\x. x + 1)" `evaluatesTo` VText "\\x. x + 1") + , testCase + "format forall" + ("format \"∀\"" `evaluatesTo` VText "\"∀\"") , testCase "concat" ("\"x = \" ++ format (2+3) ++ \"!\"" `evaluatesTo` VText "x = 5!") @@ -346,6 +349,7 @@ testEval g = where tquote :: String -> Text tquote = T.pack . show + throwsError :: Text -> (Text -> Bool) -> Assertion throwsError tm p = do result <- evaluate tm