aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/specification')
-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)))))))))