aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
authorEduardo Julian2023-01-05 02:33:52 -0400
committerEduardo Julian2023-01-05 02:33:52 -0400
commitab1829d77c7d12af344af68d6c50d391f1126640 (patch)
treeeb7a228fbe22a7631272e14b5ac6743c64dafaee /stdlib/source/spec
parent3ca054b6b992e2233d763aabc5c938ee10d116a4 (diff)
Compilation of simple literals in C++.
Diffstat (limited to '')
-rw-r--r--stdlib/source/specification/lux/world/console.lux60
-rw-r--r--stdlib/source/specification/lux/world/environment.lux34
2 files changed, 0 insertions, 94 deletions
diff --git a/stdlib/source/specification/lux/world/console.lux b/stdlib/source/specification/lux/world/console.lux
deleted file mode 100644
index c941d4da7..000000000
--- a/stdlib/source/specification/lux/world/console.lux
+++ /dev/null
@@ -1,60 +0,0 @@
-(.require
- [library
- [lux (.except)
- [abstract
- [monad (.only do)]]
- [control
- [io (.only IO)]
- ["[0]" try]
- [concurrency
- ["[0]" async (.only Async)]]]
- [data
- ["[0]" text (.only)
- ["%" \\format (.only format)]]]
- [math
- ["[0]" random]]
- [test
- ["_" property (.only Test)]
- ["[0]" unit]]]]
- [\\library
- ["[0]" /]])
-
-(def .public (spec console)
- (-> (IO (/.Console Async)) Test)
- (do random.monad
- [message (random.alphabetic 10)]
- (in (do async.monad
- [console (async.future console)
- ?write (of console write (format message text.new_line))
- ?read (of console read [])
- ?read_line (of console read_line [])
- ?close/good (of console close [])
- ?close/bad (of console close [])
-
- .let [can_write!
- (when ?write
- {try.#Success _}
- true
-
- _
- false)
-
- can_read!
- (when [?read ?read_line]
- [{try.#Success _} {try.#Success _}]
- true
-
- _
- false)
-
- can_close!
- (when [?close/good ?close/bad]
- [{try.#Success _} {try.#Failure _}]
- true
-
- _
- false)]]
- (unit.coverage [/.Console]
- (and can_write!
- can_read!
- can_close!))))))
diff --git a/stdlib/source/specification/lux/world/environment.lux b/stdlib/source/specification/lux/world/environment.lux
deleted file mode 100644
index 1a586c554..000000000
--- a/stdlib/source/specification/lux/world/environment.lux
+++ /dev/null
@@ -1,34 +0,0 @@
-(.require
- [library
- [lux (.except)
- [abstract
- [monad (.only do)]]
- [control
- ["[0]" try]
- [concurrency
- ["[0]" async (.only Async)]]]
- [data
- ["[0]" text]
- [collection
- ["[0]" dictionary]
- ["[0]" list]]]
- [math
- ["[0]" random]]
- [test
- ["_" property (.only Test)]
- ["[0]" unit]]]]
- [\\library
- ["[0]" /]])
-
-(def .public (spec subject)
- (-> (/.Environment Async) Test)
- (do random.monad
- [exit random.int]
- (in (do [! async.monad]
- [environment (/.environment ! subject)]
- (unit.coverage [/.Environment]
- (and (not (dictionary.empty? environment))
- (list.every? (|>> text.empty? not)
- (dictionary.keys environment))
- (not (text.empty? (of subject home)))
- (not (text.empty? (of subject directory)))))))))