Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Dec 9, 2020
1 parent c167c29 commit b4c6da2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/tests/units/error-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,36 @@ Rebol [
===end-group===


===start-group=== "ASSERT"
--test-- "valid assert"
--assert assert [not none? 1]
--assert all [
error? e: try [assert [not none? none]]
e/id = 'assert-failed
e/arg1 = [not none? none]
]

--test-- "valid assert/type"
x: 1
--assert assert/type [x integer! ]
--assert assert/type [x [integer!]]
x: ""
--assert all [
error? e: try [assert/type [x integer!]]
e/id = 'wrong-type
e/arg1 = 'x
]
--assert assert/type [x [integer! string!]]

--test-- "invalid assert"
;@@ https://github.com/Oldes/Rebol-issues/issues/1363
--assert all [
error? e: try [assert/type [1 integer!]]
e/id = 'invalid-arg
e/arg1 = 1
]

===end-group===


~~~end-file~~~

0 comments on commit b4c6da2

Please sign in to comment.