From 824c368f176b5b497c0016e54137ebc35d03175b Mon Sep 17 00:00:00 2001 From: Pavel Marek Date: Mon, 2 Oct 2023 14:14:13 +0200 Subject: [PATCH] Add Asserts_Spec tests --- test/Tests/src/Runtime/Asserts_Spec.enso | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/Tests/src/Runtime/Asserts_Spec.enso diff --git a/test/Tests/src/Runtime/Asserts_Spec.enso b/test/Tests/src/Runtime/Asserts_Spec.enso new file mode 100644 index 000000000000..d99d7c93d4d2 --- /dev/null +++ b/test/Tests/src/Runtime/Asserts_Spec.enso @@ -0,0 +1,27 @@ +from Standard.Base import all + +from Standard.Base.Errors.Common import Assert_Error + +from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions + +foreign js js_check = """ + 4 == 2 + 2 + +on_ci = if env.get "ENSO_RUNNER_CONTAINER_NAME" . is_nothing . not then Nothing else "Not in CI" + +spec = Test.group "Asserts" pending=on_ci <| + Test.specify "should be enabled on the CI" <| + p = Panic.catch Assert_Error (Runtime.assert False) err-> + err.payload + Meta.type_of p . should_be Assert_Error + + Test.specify "should be able to take foreign functions as expressions" <| + ret = Runtime.assert js_check + ret . should_be Nothing + + Test.specify "should be able to take lambdas as expressions" <| + Runtime.assert <| + 4 == 2 + 2 + +main = Test_Suite.run_main spec