diff options
author | Eduardo Julian | 2017-09-19 20:46:12 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-09-19 20:46:12 -0400 |
commit | 53b8f08c90a9d903d5ebffb6f37acd7224a4736c (patch) | |
tree | 7ca479a99a84b60d9dc3d021aa6c1081cfac4d65 /stdlib/test | |
parent | 61b92fcab969231092f1bb41ef9a6021a498dc8f (diff) |
- Some improvements/refactoring for durations.
Diffstat (limited to '')
-rw-r--r-- | stdlib/test/test/lux/time/duration.lux | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/stdlib/test/test/lux/time/duration.lux b/stdlib/test/test/lux/time/duration.lux index d10b9b57c..4a674420e 100644 --- a/stdlib/test/test/lux/time/duration.lux +++ b/stdlib/test/test/lux/time/duration.lux @@ -1,8 +1,7 @@ (;module: lux (lux [io] - (control [monad #+ do Monad] - [pipe]) + (control [monad #+ do Monad]) (data ["R" result]) (math ["r" random]) (time ["@" duration])) @@ -34,7 +33,6 @@ (@/<= reference sample))))) (context: "Arithmetic." - #seed +16674263968423793 [sample (|> duration (:: @ map (@;frame @;day))) frame duration factor (|> r;int (:: @ map (|>. (i.% 10) (i.max 1)))) @@ -64,17 +62,11 @@ frame)))))))) (context: "Codec" - #seed +9664448049824422386 [sample duration #let [(^open "@/") @;Eq<Duration> (^open "@/") @;Codec<Text,Duration>]] - (exec - (test "Can encode/decode durations." - (|> sample - @/encode - @/decode - (pipe;case> (#R;Success decoded) - (@/= sample decoded) - - (#R;Error error) - false))))) + (test "Can encode/decode durations." + (R;default false + (do R;Monad<Result> + [decoded (|> sample @/encode @/decode)] + (wrap (@/= sample decoded)))))) |