From a4b64bf1cdf47160b6b615d2c6493039abfd7a94 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 28 Jul 2022 17:39:01 -0400 Subject: Extracted unit-testing machinery into its own module. --- .../specification/compositor/generation/common.lux | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'stdlib/source/specification/compositor/generation/common.lux') diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux index eb1a1ac70..ba691bde7 100644 --- a/stdlib/source/specification/compositor/generation/common.lux +++ b/stdlib/source/specification/compositor/generation/common.lux @@ -40,7 +40,7 @@ [param r.i64 subject r.i64] (with_expansions [ (with_template [ ] - [(_.property + [(_.test (|> {synthesis.#Extension (list (synthesis.i64 param) (synthesis.i64 subject))} (run (..safe )) @@ -60,7 +60,7 @@ )] (all _.and - (_.property "lux i64 arithmetic-right-shift" + (_.test "lux i64 arithmetic-right-shift" (|> {synthesis.#Extension "lux i64 arithmetic-right-shift" (list (synthesis.i64 subject) (synthesis.i64 param))} @@ -83,7 +83,7 @@ subject r.i64] (`` (all _.and (,, (with_template [ ] - [(_.property + [(_.test (|> {synthesis.#Extension (list (synthesis.i64 subject))} (run (..safe )) (pipe.case @@ -101,7 +101,7 @@ (as Int))] )) (,, (with_template [ ] - [(_.property + [(_.test (|> {synthesis.#Extension (list (synthesis.i64 param) (synthesis.i64 subject))} (run (..safe )) @@ -133,7 +133,7 @@ subject ..simple_frac] (`` (all _.and (,, (with_template [ ] - [(_.property + [(_.test (|> {synthesis.#Extension (list (synthesis.f64 param) (synthesis.f64 subject))} (run (..safe )) @@ -146,7 +146,7 @@ ["lux f64 %" f.% f.=] )) (,, (with_template [ ] - [(_.property + [(_.test (|> {synthesis.#Extension (list (synthesis.f64 param) (synthesis.f64 subject))} (run (..safe )) @@ -162,7 +162,7 @@ ["lux f64 <" f.<] )) (,, (with_template [ ] - [(_.property + [(_.test (|> {synthesis.#Extension (list)} (run (..safe )) (//case.verify )))] @@ -171,7 +171,7 @@ ["lux f64 max" ("lux f64 max")] ["lux f64 smallest" ("lux f64 smallest")] )) - (_.property "'lux f64 i64 && 'lux i64 f64'" + (_.test "'lux f64 i64 && 'lux i64 f64'" (|> (run (..safe "lux f64 i64") (|> subject synthesis.f64 (list) {synthesis.#Extension "lux f64 i64"} @@ -197,7 +197,7 @@ pre_rep_all (|> sample_lower (list.repeated sample_size) (text.interposed sample_upper)) post_rep_all (|> sample_lower (list.repeated sample_size) (text.interposed sample_alpha))]] (all _.and - (_.property "Can compare texts for equality." + (_.test "Can compare texts for equality." (and (|> {synthesis.#Extension "lux text =" (list sample_lowerS sample_lowerS)} (run (..safe "lux text =")) (pipe.case @@ -214,7 +214,7 @@ _ false)))) - (_.property "Can compare texts for order." + (_.test "Can compare texts for order." (|> {synthesis.#Extension "lux text <" (list sample_lowerS sample_upperS)} (run (..safe "lux text <")) (pipe.case @@ -223,7 +223,7 @@ {try.#Failure _} false))) - (_.property "Can get length of text." + (_.test "Can get length of text." (|> {synthesis.#Extension "lux text size" (list sample_lowerS)} (run (..safe "lux text size")) (pipe.case @@ -232,7 +232,7 @@ _ false))) - (_.property "Can concatenate text." + (_.test "Can concatenate text." (|> {synthesis.#Extension "lux text size" (list concatenatedS)} (run (..safe "lux text size")) (pipe.case @@ -241,7 +241,7 @@ _ false))) - (_.property "Can find index of sub-text." + (_.test "Can find index of sub-text." (and (|> {synthesis.#Extension "lux text index" (list concatenatedS sample_lowerS (synthesis.i64 +0))} @@ -281,10 +281,10 @@ _ false))))] - (_.property "Can clip text to extract sub-text." + (_.test "Can clip text to extract sub-text." (and (test_clip 0 sample_size sample_lower) (test_clip sample_size sample_size sample_upper)))) - (_.property "Can extract individual characters from text." + (_.test "Can extract individual characters from text." (|> {synthesis.#Extension "lux text char" (list sample_lowerS (synthesis.i64 char_idx))} @@ -305,7 +305,7 @@ (do r.monad [message (r.alphabetic 5)] (all _.and - (_.property "Can log messages." + (_.test "Can log messages." (|> {synthesis.#Extension "lux io log" (list (synthesis.text (format "LOG: " message)))} (run (..safe "lux io log")) @@ -315,7 +315,7 @@ {try.#Failure _} false))) - (_.property "Can throw runtime errors." + (_.test "Can throw runtime errors." (and (|> {synthesis.#Extension "lux try" (list (synthesis.function/abstraction [synthesis.#environment (list) -- cgit v1.2.3