release 0.1.0
This commit is contained in:
commit
30d94536a9
90 changed files with 7722 additions and 0 deletions
33
modules/core/tests/option.owa
Normal file
33
modules/core/tests/option.owa
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
(namespace tests.option
|
||||
(test.case "option.ok"
|
||||
(seq
|
||||
(def opt (option.ok 42))
|
||||
(assert.ok! (option.ok? opt))
|
||||
(assert.eq! (vec.get opt 1) 42)
|
||||
)
|
||||
)
|
||||
|
||||
(test.case "option.err"
|
||||
(seq
|
||||
(def opt (option.err "error"))
|
||||
(assert.ok! (option.err? opt))
|
||||
(assert.eq! (vec.get opt 1) "error")
|
||||
)
|
||||
)
|
||||
|
||||
(test.case "option.ok?"
|
||||
(assert.ok! (option.ok? (option.ok 1)))
|
||||
(assert.not! (option.ok? (option.err "x")))
|
||||
)
|
||||
|
||||
(test.case "option.err?"
|
||||
(assert.ok! (option.err? (option.err "x")))
|
||||
(assert.not! (option.err? (option.ok 1)))
|
||||
)
|
||||
|
||||
(test.case "option.option?"
|
||||
(assert.ok! (option? (option.ok 1)))
|
||||
(assert.ok! (option? (option.err "x")))
|
||||
(assert.not! (option? [1 2]))
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue