diff options
author | Eduardo Julian | 2020-11-26 19:37:11 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-11-26 19:37:11 -0400 |
commit | dbb658bd7976c073a2bf314f194b36b30c45784b (patch) | |
tree | 4771bab5e41fe2ba3939bb3a12941a558b68e712 /stdlib/source/test/lux/world | |
parent | c4bbfea18d995948012f45a6afda7a6e6ba56f84 (diff) |
Allow name formatting for JVM imports, similar to Lux module imports.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/world.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/environment.lux | 31 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/file.lux | 6 |
3 files changed, 36 insertions, 3 deletions
diff --git a/stdlib/source/test/lux/world.lux b/stdlib/source/test/lux/world.lux index a01bdb929..e7aa38aa1 100644 --- a/stdlib/source/test/lux/world.lux +++ b/stdlib/source/test/lux/world.lux @@ -2,6 +2,7 @@ [lux #* ["_" test (#+ Test)]] ["." / #_ + ["#." environment] ["#." file] ["#." shell] ["#." console]]) @@ -9,6 +10,7 @@ (def: #export test Test ($_ _.and + /environment.test /file.test /shell.test /console.test diff --git a/stdlib/source/test/lux/world/environment.lux b/stdlib/source/test/lux/world/environment.lux new file mode 100644 index 000000000..2ab284132 --- /dev/null +++ b/stdlib/source/test/lux/world/environment.lux @@ -0,0 +1,31 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [control + [concurrency + ["." promise]]] + [data + ["." text] + [collection + ["." dictionary] + ["." list]]] + [math + ["." random]]] + {1 + ["." /]}) + +(def: #export test + Test + (<| (_.covering /._) + (_.with-cover [/.Environment /.Property]) + (do random.monad + [_ (wrap [])] + (wrap (do promise.monad + [environment (promise.future /.read)] + (_.claim [/.read] + (and (not (dictionary.empty? environment)) + (|> environment + dictionary.keys + (list.every? (|>> text.empty? not)))))))))) diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index 55cfe94bc..fa1edcfe8 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -1,7 +1,7 @@ (.module: [lux #* ["%" data/text/format (#+ format)] - ["r" math/random (#+ Random) ("#@." monad)] + ["r" math/random (#+ Random) ("#\." monad)] ["_" test (#+ Test)] [abstract/monad (#+ do)] [control @@ -34,7 +34,7 @@ (def: (creation-and-deletion number) (-> Nat Test) - (r@wrap (do promise.monad + (r\wrap (do promise.monad [#let [path (format "temp_file_" (%.nat number))] result (promise.future (do (try.with io.monad) @@ -53,7 +53,7 @@ (def: (read-and-write number data) (-> Nat Binary Test) - (r@wrap (do promise.monad + (r\wrap (do promise.monad [#let [path (format "temp_file_" (%.nat number))] result (promise.future (do (try.with io.monad) |