diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/ffi.py.lux | 71 |
1 files changed, 54 insertions, 17 deletions
diff --git a/stdlib/source/test/lux/ffi.py.lux b/stdlib/source/test/lux/ffi.py.lux index b05973bb8..18aab4188 100644 --- a/stdlib/source/test/lux/ffi.py.lux +++ b/stdlib/source/test/lux/ffi.py.lux @@ -1,24 +1,61 @@ (.module: - [lux #* - ["_" test (#+ Test)] - [abstract - [monad (#+ do)]] - [control - ["." try]] - [data - ["." text ("#\." equivalence)]] - [math - ["." random (#+ Random)] - [number - ["." nat] - ["." frac]]]] - [\\ + [library + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [math + ["." random] + [number + ["i" int]]]]] + [\\library ["." /]]) +(/.import: os + ["#::." + (#static R_OK /.Integer) + (#static W_OK /.Integer)]) + (def: #export test Test (do {! random.monad} - [] + [boolean random.bit + integer random.int + float random.frac + string (random.ascii/lower 1)] (<| (_.covering /._) - (_.test "TBD" - true)))) + (`` ($_ _.and + (~~ (template [<type> <sample>] + [(_.cover [<type>] + (exec + (: <type> <sample>) + true))] + + [/.Boolean boolean] + [/.Integer integer] + [/.Float float] + [/.String string] + )) + (_.for [/.Object] + ($_ _.and + (~~ (template [<type>] + [(_.cover [<type>] + (exec + (|> [] + (:as <type>) + (: (Ex [a] (/.Object a)))) + true))] + + [/.None] + [/.Dict] + )))) + (_.cover [/.Function /.lambda] + (exec + (|> (/.lambda [input/0] input/0) + (: /.Function) + (: (Ex [a] (/.Object a)))) + true)) + (_.cover [/.import:] + (and (i.= (os::R_OK) (os::R_OK)) + (not (i.= (os::W_OK) (os::R_OK))))) + ))))) |