aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/test.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/test.lux')
-rw-r--r--stdlib/source/library/lux/test.lux35
1 files changed, 18 insertions, 17 deletions
diff --git a/stdlib/source/library/lux/test.lux b/stdlib/source/library/lux/test.lux
index 411c6c1c7..16df02a68 100644
--- a/stdlib/source/library/lux/test.lux
+++ b/stdlib/source/library/lux/test.lux
@@ -42,7 +42,8 @@
["[0]" instant]]]]]
[/
["//" unit]
- ["[0]" coverage (.only Coverage)]])
+ ["[0]" coverage (.only Coverage)]
+ ["[0]" tally (.only Tally)]])
(type .public Test
(Random //.Test))
@@ -94,8 +95,8 @@
[prng result])))
(def failed?
- (-> //.Tally Bit)
- (|>> (the //.#failures) (n.> 0)))
+ (-> Tally Bit)
+ (|>> (the tally.#failures) (n.> 0)))
(def separator
text.new_line)
@@ -127,21 +128,21 @@
product.right))))])))))
(def (description duration tally)
- (-> Duration //.Tally Text)
- (let [successes (the //.#successes tally)
- failures (the //.#failures tally)
- missing (set.difference (the //.#actual tally)
- (the //.#expected tally))
- unexpected (set.difference (the //.#expected tally)
- (the //.#actual tally))
+ (-> Duration Tally Text)
+ (let [successes (the tally.#successes tally)
+ failures (the tally.#failures tally)
+ missing (set.difference (the tally.#actual tally)
+ (the tally.#expected tally))
+ unexpected (set.difference (the tally.#expected tally)
+ (the tally.#actual tally))
report (is (-> Coverage Text)
(|>> set.list
(list.sorted (at symbol.order <))
(exception.listing %.symbol)))
- expected_coverage (set.size (the //.#expected tally))
+ expected_coverage (set.size (the tally.#expected tally))
unexpected_coverage (set.size unexpected)
actual_coverage (n.- unexpected_coverage
- (set.size (the //.#actual tally)))
+ (set.size (the tally.#actual tally)))
coverage (case expected_coverage
0 "N/A"
expected (let [missing_ratio (f./ (n.frac expected)
@@ -204,7 +205,7 @@
(console.write_line report console))
<else>))]
(async.future (at environment.default exit
- (case (the //.#failures tally)
+ (case (the tally.#failures tally)
0 ..success_exit_code
_ ..failure_exit_code)))))
@@ -237,7 +238,7 @@
(-> (List Test) Test)
(case (list.size tests)
0
- (random#in (async#in [//.start ""]))
+ (random#in (async#in [tally.empty ""]))
expected_tests
(do random.monad
@@ -254,10 +255,10 @@
{try.#Failure error}
(//.test (exception.error ..error_during_execution [error]) false))))
- state (is (Atom (Dictionary Nat [//.Tally Text]))
+ state (is (Atom (Dictionary Nat [Tally Text]))
(atom.atom (dictionary.empty n.order)))
[read! write!] (is [//.Test
- (async.Resolver [//.Tally Text])]
+ (async.Resolver [Tally Text])]
(async.async []))
_ (list#mix (function (_ test index)
(exec
@@ -271,7 +272,7 @@
(list#each product.right))]
(write! [(|> assertions
(list#each product.left)
- (list#mix //.total //.start))
+ (list#mix tally.and tally.empty))
(|> assertions
(list#each product.right)
(text.interposed ..separator))]))