diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/test.lux | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/stdlib/source/test/lux/test.lux b/stdlib/source/test/lux/test.lux index feec778bb..4e9638e6d 100644 --- a/stdlib/source/test/lux/test.lux +++ b/stdlib/source/test/lux/test.lux @@ -26,8 +26,8 @@ (-> Text Text Nat Nat [/.Tally Text] Bit) (and (text.contains? expected_message/0 message) (text.contains? expected_message/1 message) - (n.= successes (value@ /.#successes tally)) - (n.= failures (value@ /.#failures tally)))) + (n.= successes (the /.#successes tally)) + (n.= failures (the /.#failures tally)))) (def: assertion /.Test @@ -42,10 +42,10 @@ (/.cover' [/.assertion /.Tally] (and (text.ends_with? expected_message/0 success_message) (text.ends_with? expected_message/0 failure_message) - (and (n.= 1 (value@ /.#successes success_tally)) - (n.= 0 (value@ /.#failures success_tally))) - (and (n.= 0 (value@ /.#successes failure_tally)) - (n.= 1 (value@ /.#failures failure_tally))))))) + (and (n.= 1 (the /.#successes success_tally)) + (n.= 0 (the /.#failures success_tally))) + (and (n.= 0 (the /.#successes failure_tally)) + (n.= 1 (the /.#failures failure_tally))))))) (in (do async.monad [tt (/.and' (/.assertion expected_message/0 true) (/.assertion expected_message/1 true)) @@ -83,10 +83,10 @@ [[pre_tally pre_message] pre [post_tally post_message] post] (/.cover' [/.seed] - (and (and (n.= 1 (value@ /.#successes pre_tally)) - (n.= 0 (value@ /.#failures pre_tally))) - (and (n.= 1 (value@ /.#successes post_tally)) - (n.= 0 (value@ /.#failures post_tally))))))))) + (and (and (n.= 1 (the /.#successes pre_tally)) + (n.= 0 (the /.#failures pre_tally))) + (and (n.= 1 (the /.#successes post_tally)) + (n.= 0 (the /.#failures post_tally))))))))) (def: times /.Test @@ -96,9 +96,9 @@ (in (do async.monad [[tally error] times_assertion] (/.cover' [/.must_try_test_at_least_once] - (and (text.contains? (value@ exception.#label /.must_try_test_at_least_once) error) - (n.= 0 (value@ /.#successes tally)) - (n.= 1 (value@ /.#failures tally))))))) + (and (text.contains? (the exception.#label /.must_try_test_at_least_once) error) + (n.= 0 (the /.#successes tally)) + (n.= 1 (the /.#failures tally))))))) (do [! random.monad] [expected (# ! each (|>> (n.% 10) ++) random.nat) .let [counter (: (Atom Nat) @@ -113,8 +113,8 @@ actual (async.future (atom.read! counter))] (/.cover' [/.times] (and (n.= expected actual) - (n.= 1 (value@ /.#successes tally)) - (n.= 0 (value@ /.#failures tally))))))) + (n.= 1 (the /.#successes tally)) + (n.= 0 (the /.#failures tally))))))) )) (def: in_parallel @@ -136,8 +136,8 @@ actual (async.future (atom.read! counter))] (/.cover' [/.in_parallel] (and (n.= expected actual) - (n.= expected (value@ /.#successes tally)) - (n.= 0 (value@ /.#failures tally))))))) + (n.= expected (the /.#successes tally)) + (n.= 0 (the /.#failures tally))))))) (do [! random.monad] [expected (# ! each (|>> (n.% 10) ++) random.nat) .let [counter (: (Atom Nat) @@ -154,10 +154,10 @@ [[tally error] assertion actual (async.future (atom.read! counter))] (/.cover' [/.error_during_execution] - (let [correct_error! (text.contains? (value@ exception.#label /.error_during_execution) error) + (let [correct_error! (text.contains? (the exception.#label /.error_during_execution) error) no_complete_run! (n.= 0 actual) - no_successes! (n.= 0 (value@ /.#successes tally)) - ran_all_tests! (n.= expected (value@ /.#failures tally))] + no_successes! (n.= 0 (the /.#successes tally)) + ran_all_tests! (n.= expected (the /.#failures tally))] (and correct_error! no_complete_run! no_successes! @@ -177,10 +177,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.covering] - (and (and (set.empty? (value@ /.#expected_coverage not_covering)) - (set.empty? (value@ /.#actual_coverage not_covering))) - (and (not (set.empty? (value@ /.#expected_coverage covering))) - (set.empty? (value@ /.#actual_coverage covering)))))))) + (and (and (set.empty? (the /.#expected_coverage not_covering)) + (set.empty? (the /.#actual_coverage not_covering))) + (and (not (set.empty? (the /.#expected_coverage covering))) + (set.empty? (the /.#actual_coverage covering)))))))) (do random.monad [not_covering (/.covering .._ (/.test "" true)) covering (/.covering .._ (/.cover [..dummy_target] true))] @@ -188,10 +188,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.cover] - (and (and (not (set.empty? (value@ /.#expected_coverage not_covering))) - (not (set.member? (value@ /.#actual_coverage not_covering) (symbol ..dummy_target)))) - (and (not (set.empty? (value@ /.#expected_coverage covering))) - (set.member? (value@ /.#actual_coverage covering) (symbol ..dummy_target)))))))) + (and (and (not (set.empty? (the /.#expected_coverage not_covering))) + (not (set.member? (the /.#actual_coverage not_covering) (symbol ..dummy_target)))) + (and (not (set.empty? (the /.#expected_coverage covering))) + (set.member? (the /.#actual_coverage covering) (symbol ..dummy_target)))))))) (do random.monad [not_covering (/.covering .._ (/.test "" true)) covering (/.covering .._ (in (/.cover' [..dummy_target] true)))] @@ -199,10 +199,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.cover'] - (and (and (not (set.empty? (value@ /.#expected_coverage not_covering))) - (not (set.member? (value@ /.#actual_coverage not_covering) (symbol ..dummy_target)))) - (and (not (set.empty? (value@ /.#expected_coverage covering))) - (set.member? (value@ /.#actual_coverage covering) (symbol ..dummy_target)))))))) + (and (and (not (set.empty? (the /.#expected_coverage not_covering))) + (not (set.member? (the /.#actual_coverage not_covering) (symbol ..dummy_target)))) + (and (not (set.empty? (the /.#expected_coverage covering))) + (set.member? (the /.#actual_coverage covering) (symbol ..dummy_target)))))))) (do random.monad [not_covering (/.covering .._ (/.test "" true)) covering (/.covering .._ (/.for [..dummy_target] (/.test "" true)))] @@ -210,10 +210,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.for] - (and (and (not (set.empty? (value@ /.#expected_coverage not_covering))) - (not (set.member? (value@ /.#actual_coverage not_covering) (symbol ..dummy_target)))) - (and (not (set.empty? (value@ /.#expected_coverage covering))) - (set.member? (value@ /.#actual_coverage covering) (symbol ..dummy_target)))))))) + (and (and (not (set.empty? (the /.#expected_coverage not_covering))) + (not (set.member? (the /.#actual_coverage not_covering) (symbol ..dummy_target)))) + (and (not (set.empty? (the /.#expected_coverage covering))) + (set.member? (the /.#actual_coverage covering) (symbol ..dummy_target)))))))) )) (def: .public test @@ -240,10 +240,10 @@ (/.cover' [/.test] (and (text.ends_with? (%.text expected_message/0) success_message) (text.ends_with? (%.text expected_message/0) failure_message) - (and (n.= 1 (value@ /.#successes success_tally)) - (n.= 0 (value@ /.#failures success_tally))) - (and (n.= 0 (value@ /.#successes failure_tally)) - (n.= 1 (value@ /.#failures failure_tally)))))))) + (and (n.= 1 (the /.#successes success_tally)) + (n.= 0 (the /.#failures success_tally))) + (and (n.= 0 (the /.#successes failure_tally)) + (n.= 1 (the /.#failures failure_tally)))))))) (do ! [tt (/.and (/.test expected_message/0 true) (/.test expected_message/1 true)) @@ -274,18 +274,18 @@ (text.contains? expected_message/0 success_message)) (and (text.contains? expected_context failure_message) (text.contains? expected_message/0 failure_message)) - (and (n.= 1 (value@ /.#successes success_tally)) - (n.= 0 (value@ /.#failures success_tally))) - (and (n.= 0 (value@ /.#successes failure_tally)) - (n.= 1 (value@ /.#failures failure_tally)))))))) + (and (n.= 1 (the /.#successes success_tally)) + (n.= 0 (the /.#failures success_tally))) + (and (n.= 0 (the /.#successes failure_tally)) + (n.= 1 (the /.#failures failure_tally)))))))) (do ! [failure_assertion (/.failure expected_message/0)] (in (do async.monad [[failure_tally failure_message] failure_assertion] (/.cover' [/.failure] (and (text.contains? expected_message/0 failure_message) - (and (n.= 0 (value@ /.#successes failure_tally)) - (n.= 1 (value@ /.#failures failure_tally)))))))) + (and (n.= 0 (the /.#successes failure_tally)) + (n.= 1 (the /.#failures failure_tally)))))))) (do ! [success_assertion (/.lifted expected_message/0 (in true)) failure_assertion (/.lifted expected_message/0 (in false))] @@ -295,10 +295,10 @@ (/.cover' [/.lifted] (and (text.contains? expected_message/0 success_message) (text.contains? expected_message/0 failure_message) - (and (n.= 1 (value@ /.#successes success_tally)) - (n.= 0 (value@ /.#failures success_tally))) - (and (n.= 0 (value@ /.#successes failure_tally)) - (n.= 1 (value@ /.#failures failure_tally)))))))) + (and (n.= 1 (the /.#successes success_tally)) + (n.= 0 (the /.#failures success_tally))) + (and (n.= 0 (the /.#successes failure_tally)) + (n.= 1 (the /.#failures failure_tally)))))))) ..times ..in_parallel ..coverage |