diff options
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux/extension.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/host.scm.lux | 24 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/file.lux | 66 |
3 files changed, 61 insertions, 35 deletions
diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux index cdd934e3e..8ff1cdc00 100644 --- a/stdlib/source/test/lux/extension.lux +++ b/stdlib/source/test/lux/extension.lux @@ -7,7 +7,8 @@ ["." python] ["." lua] ["." ruby] - ["." php]] + ["." php] + ["." scheme]] [abstract [monad (#+ do)]] [control @@ -69,7 +70,8 @@ @.python (python.unicode self) @.lua (lua.string self) @.ruby (ruby.string self) - @.php (php.string self)}))))) + @.php (php.string self) + @.scheme (scheme.string self)}))))) (for {@.old (as_is)} diff --git a/stdlib/source/test/lux/host.scm.lux b/stdlib/source/test/lux/host.scm.lux new file mode 100644 index 000000000..0b6cac81b --- /dev/null +++ b/stdlib/source/test/lux/host.scm.lux @@ -0,0 +1,24 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [control + ["." try]] + [data + ["." text ("#\." equivalence)]] + [math + ["." random (#+ Random)] + [number + ["." nat] + ["." frac]]]] + {1 + ["." /]}) + +(def: #export test + Test + (do {! random.monad} + [] + (<| (_.covering /._) + (_.test "TBD" + true)))) diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index b59202972..002d76c42 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -35,40 +35,40 @@ (let [millis +1,000] (|>> (i./ millis) (i.* millis)))) -(def: (creation_and_deletion number) - (-> Nat Test) - (random\wrap - (do promise.monad - [#let [path (format "temp_file_" (%.nat number))] - result (promise.future - (do (try.with io.monad) - [#let [check_existence! (: (IO (Try Bit)) - (try.lift io.monad (/.exists? io.monad /.default path)))] - pre! check_existence! - file (!.use (\ /.default create_file) path) - post! check_existence! - _ (!.use (\ file delete) []) - remains? check_existence!] - (wrap (and (not pre!) - post! - (not remains?)))))] - (_.assert "Can create/delete files." - (try.default #0 result))))) +## (def: (creation_and_deletion number) +## (-> Nat Test) +## (random\wrap +## (do promise.monad +## [#let [path (format "temp_file_" (%.nat number))] +## result (promise.future +## (do (try.with io.monad) +## [#let [check_existence! (: (IO (Try Bit)) +## (try.lift io.monad (/.exists? io.monad /.default path)))] +## pre! check_existence! +## file (!.use (\ /.default create_file) path) +## post! check_existence! +## _ (!.use (\ file delete) []) +## remains? check_existence!] +## (wrap (and (not pre!) +## post! +## (not remains?)))))] +## (_.assert "Can create/delete files." +## (try.default #0 result))))) -(def: (read_and_write number data) - (-> Nat Binary Test) - (random\wrap - (do promise.monad - [#let [path (format "temp_file_" (%.nat number))] - result (promise.future - (do (try.with io.monad) - [file (!.use (\ /.default create_file) path) - _ (!.use (\ file over_write) data) - content (!.use (\ file content) []) - _ (!.use (\ file delete) [])] - (wrap (\ binary.equivalence = data content))))] - (_.assert "Can write/read files." - (try.default #0 result))))) +## (def: (read_and_write number data) +## (-> Nat Binary Test) +## (random\wrap +## (do promise.monad +## [#let [path (format "temp_file_" (%.nat number))] +## result (promise.future +## (do (try.with io.monad) +## [file (!.use (\ /.default create_file) path) +## _ (!.use (\ file over_write) data) +## content (!.use (\ file content) []) +## _ (!.use (\ file delete) [])] +## (wrap (\ binary.equivalence = data content))))] +## (_.assert "Can write/read files." +## (try.default #0 result))))) (def: #export test Test |