From d29e091e98dabb8dfcf816899ada480ecbf7e357 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 23 Dec 2020 06:33:44 -0400 Subject: Refactored "export" common syntax. --- stdlib/source/test/lux.lux | 86 +++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'stdlib/source/test/lux.lux') diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 7b85a6ff4..7caf3eba1 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -140,7 +140,7 @@ ($_ _.and (do random.monad [factor (random\map (|>> (n.% 10) (n.max 1)) random.nat) - iterations (random\map (n.% 100) random.nat) + iterations (random\map (n.% 10) random.nat) #let [expected (n.* factor iterations)]] (_.test "Can write loops." (n.= expected @@ -232,50 +232,50 @@ (def: test (<| (_.context (name.module (name-of /._))) - ($_ _.and - (!bundle ($_ _.and - (<| (_.context "Identity.") - ..identity) - (<| (_.context "Increment & decrement.") - ..increment-and-decrement) - (<| (_.context "Even or odd.") - ($_ _.and - (<| (_.context "Natural numbers.") - (..even-or-odd random.nat n.even? n.odd?)) - (<| (_.context "Integers.") - (..even-or-odd random.int i.even? i.odd?)))) - (<| (_.context "Minimum and maximum.") - (`` ($_ _.and - (~~ (template [<=> ] - [(<| (_.context ) - (..minimum-and-maximum <=> [ ] [ ]))] + (_.in-parallel + (list (!bundle ($_ _.and + (<| (_.context "Identity.") + ..identity) + (<| (_.context "Increment & decrement.") + ..increment-and-decrement) + (<| (_.context "Even or odd.") + ($_ _.and + (<| (_.context "Natural numbers.") + (..even-or-odd random.nat n.even? n.odd?)) + (<| (_.context "Integers.") + (..even-or-odd random.int i.even? i.odd?)))) + (<| (_.context "Minimum and maximum.") + (`` ($_ _.and + (~~ (template [<=> ] + [(<| (_.context ) + (..minimum-and-maximum <=> [ ] [ ]))] - [i.= i.< i.min i.> i.max random.int "Integers."] - [n.= n.< n.min n.> n.max random.nat "Natural numbers."] - [r.= r.< r.min r.> r.max random.rev "Revolutions."] - [f.= f.< f.min f.> f.max random.safe-frac "Fractions."] - ))))) - (<| (_.context "Conversion.") - (`` ($_ _.and - (~~ (template [<=> ] - [(<| (_.context (format (%.name (name-of )) - " " (%.name (name-of )))) - (..conversion <=>))] + [i.= i.< i.min i.> i.max random.int "Integers."] + [n.= n.< n.min n.> n.max random.nat "Natural numbers."] + [r.= r.< r.min r.> r.max random.rev "Revolutions."] + [f.= f.< f.min f.> f.max random.safe-frac "Fractions."] + ))))) + (<| (_.context "Conversion.") + (`` ($_ _.and + (~~ (template [<=> ] + [(<| (_.context (format (%.name (name-of )) + " " (%.name (name-of )))) + (..conversion <=>))] - [i.= .nat .int (random\map (i.% +1,000,000) random.int)] - [n.= .int .nat (random\map (n.% 1,000,000) random.nat)] - [i.= i.frac f.int (random\map (i.% +1,000,000) random.int)] - [f.= f.int i.frac (random\map (|>> (i.% +1,000,000) i.frac) random.int)] - [r.= r.frac f.rev frac-rev] - ))))) - (<| (_.context "Prelude macros.") - ..prelude-macros) - (<| (_.context "Templates.") - ..templates) - (<| (_.context "Cross-platform support.") - ..cross-platform-support))) - ..sub-tests - ))) + [i.= .nat .int (random\map (i.% +1,000,000) random.int)] + [n.= .int .nat (random\map (n.% 1,000,000) random.nat)] + [i.= i.frac f.int (random\map (i.% +1,000,000) random.int)] + [f.= f.int i.frac (random\map (|>> (i.% +1,000,000) i.frac) random.int)] + [r.= r.frac f.rev frac-rev] + ))))) + (<| (_.context "Prelude macros.") + ..prelude-macros) + (<| (_.context "Templates.") + ..templates) + (<| (_.context "Cross-platform support.") + ..cross-platform-support))) + ..sub-tests + )))) (program: args (<| io -- cgit v1.2.3