diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/world/file.lux | 66 |
1 files changed, 33 insertions, 33 deletions
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 |