From 14e381de130f0c8d3e333cf0523c6c98b9aa84b1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 17 Oct 2017 02:01:41 -0400 Subject: - Added "for" macro to specify platform-dependent code. - Some refactoring/re-naming. --- stdlib/test/test/lux.lux | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux index 88f8c6f79..f44430c6c 100644 --- a/stdlib/test/test/lux.lux +++ b/stdlib/test/test/lux.lux @@ -6,7 +6,7 @@ [math] ["r" math/random] (data [maybe] - [text "T/" Eq] + [text "text/" Eq] text/format) [meta] (meta ["s" syntax #+ syntax:]))) @@ -96,7 +96,7 @@ ## Skip this test for Deg ## because Deg division loses the last ## 32 bits of precision. - (or (T/= "Deg" category) + (or (text/= "Deg" category) (and (|> x (* <1>) (= x)) (|> x (/ <1>) (= x)))))) @@ -111,7 +111,7 @@ ## Skip this test for Deg ## because Deg division loses the last ## 32 bits of precision. - (or (T/= "Deg" category) + (or (text/= "Deg" category) (or (> x' y) (|> x' (/ y) (* y) (= x')))) ))] @@ -172,9 +172,19 @@ (template: (hypotenuse x y) (i.+ (i.* x x) (i.* y y))) -(context: "Templates" +(context: "Templates." [x r;int y r;int] (test "Template application is a stand-in for the templated code." (i.= (i.+ (i.* x x) (i.* y y)) (hypotenuse x y)))) + +(context: "Cross-platform support." + ($_ seq + (test "Can provide default in case there is no particular platform support." + (for {"" false} + true)) + (test "Can pick code depending on the platform being targeted." + (for {"JVM" true + "JS" true} + false)))) -- cgit v1.2.3