Skip to content

Commit

Permalink
Add Asserts_Spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Akirathan committed Oct 2, 2023
1 parent a0c62e6 commit 824c368
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/Tests/src/Runtime/Asserts_Spec.enso
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 824c368

Please sign in to comment.