aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/control/continuation.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/control/continuation.lux')
-rw-r--r--stdlib/source/test/lux/control/continuation.lux96
1 files changed, 48 insertions, 48 deletions
diff --git a/stdlib/source/test/lux/control/continuation.lux b/stdlib/source/test/lux/control/continuation.lux
index 77dffb213..062142453 100644
--- a/stdlib/source/test/lux/control/continuation.lux
+++ b/stdlib/source/test/lux/control/continuation.lux
@@ -44,53 +44,53 @@
(_.for [/.monad]
($monad.spec ..injection ..comparison /.monad))
- (_.cover [/.result]
- (n.= sample (/.result (_#in sample))))
- (_.cover [/.with_current]
- (n.= (n.* 2 sample)
- (/.result (do [! /.monad]
- [value (/.with_current
- (function (_ k)
- (do !
- [temp (k sample)]
- ... If this code where to run,
- ... the output would be
- ... (n.* 4 sample)
- (k temp))))]
- (in (n.* 2 value))))))
- (_.cover [/.portal]
- (n.= (n.+ 100 sample)
- (/.result (do /.monad
- [[restart [output idx]] (/.portal [sample 0])]
- (if (n.< 10 idx)
- (restart [(n.+ 10 output) (++ idx)])
- (in output))))))
- (_.cover [/.shift /.reset]
- (let [(open "_#[0]") /.monad
- (open "list#[0]") (list.equivalence n.equivalence)
- visit (is (-> (List Nat)
- (/.Cont (List Nat) (List Nat)))
- (function (visit xs)
- (case xs
- {.#End}
- (_#in {.#End})
+ (_.coverage [/.result]
+ (n.= sample (/.result (_#in sample))))
+ (_.coverage [/.with_current]
+ (n.= (n.* 2 sample)
+ (/.result (do [! /.monad]
+ [value (/.with_current
+ (function (_ k)
+ (do !
+ [temp (k sample)]
+ ... If this code where to run,
+ ... the output would be
+ ... (n.* 4 sample)
+ (k temp))))]
+ (in (n.* 2 value))))))
+ (_.coverage [/.portal]
+ (n.= (n.+ 100 sample)
+ (/.result (do /.monad
+ [[restart [output idx]] (/.portal [sample 0])]
+ (if (n.< 10 idx)
+ (restart [(n.+ 10 output) (++ idx)])
+ (in output))))))
+ (_.coverage [/.shift /.reset]
+ (let [(open "_#[0]") /.monad
+ (open "list#[0]") (list.equivalence n.equivalence)
+ visit (is (-> (List Nat)
+ (/.Cont (List Nat) (List Nat)))
+ (function (visit xs)
+ (case xs
+ {.#End}
+ (_#in {.#End})
- {.#Item x xs'}
- (do [! /.monad]
- [output (/.shift (function (_ k)
- (do !
- [tail (k xs')]
- (in {.#Item x tail}))))]
- (visit output)))))]
- (list#= elems
- (/.result (/.reset (visit elems))))))
- (_.cover [/.continued]
- (/.continued (same? sample)
- (is (/.Cont Nat Bit)
- (function (_ next)
- (next sample)))))
- (_.cover [/.pending]
- (/.continued (same? sample)
- (is (/.Cont Nat Bit)
- (/.pending sample))))
+ {.#Item x xs'}
+ (do [! /.monad]
+ [output (/.shift (function (_ k)
+ (do !
+ [tail (k xs')]
+ (in {.#Item x tail}))))]
+ (visit output)))))]
+ (list#= elems
+ (/.result (/.reset (visit elems))))))
+ (_.coverage [/.continued]
+ (/.continued (same? sample)
+ (is (/.Cont Nat Bit)
+ (function (_ next)
+ (next sample)))))
+ (_.coverage [/.pending]
+ (/.continued (same? sample)
+ (is (/.Cont Nat Bit)
+ (/.pending sample))))
)))