aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2021-05-24 11:23:40 -0400
committerEduardo Julian2021-05-24 11:23:40 -0400
commit86538182a50390e7882778cc02e69482e846edd5 (patch)
tree5f2b5800d4f9bd63355d78bc541110aaf0c6b134 /stdlib/source/test
parent20a3f2650e2e72b5f4e525bee8a6354a711f575b (diff)
Almost done with Scheme.
But will have to postpone finishing it because Kawa is not up to snuff.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/extension.lux6
-rw-r--r--stdlib/source/test/lux/host.scm.lux24
-rw-r--r--stdlib/source/test/lux/world/file.lux66
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