aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification/compositor/generation/case.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-04-09 03:03:46 -0400
committerEduardo Julian2022-04-09 03:03:46 -0400
commit04c7f49a732380a2b9f72b1b937171b341c24323 (patch)
treed54c92bf10665bba0ec4643746becce569604fb2 /stdlib/source/specification/compositor/generation/case.lux
parentf11afb9d2dfe2d59b41e8056eb8c4ae65268415f (diff)
Better names for testing macros (plus better indentation).
Diffstat (limited to 'stdlib/source/specification/compositor/generation/case.lux')
-rw-r--r--stdlib/source/specification/compositor/generation/case.lux110
1 files changed, 55 insertions, 55 deletions
diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux
index 12fa81a14..1e5502e17 100644
--- a/stdlib/source/specification/compositor/generation/case.lux
+++ b/stdlib/source/specification/compositor/generation/case.lux
@@ -101,12 +101,12 @@
(-> Runner Test)
(do r.monad
[value r.safe_frac]
- (_.test (%.symbol (symbol synthesis.branch/let))
- (|> (synthesis.branch/let [(synthesis.f64 value)
- 0
- (synthesis.variable/local 0)])
- (run "let_spec")
- (verify value)))))
+ (_.property (%.symbol (symbol synthesis.branch/let))
+ (|> (synthesis.branch/let [(synthesis.f64 value)
+ 0
+ (synthesis.variable/local 0)])
+ (run "let_spec")
+ (verify value)))))
(def: (if_spec run)
(-> Runner Test)
@@ -114,12 +114,12 @@
[on_true r.safe_frac
on_false (|> r.safe_frac (r.only (|>> (f.= on_true) not)))
verdict r.bit]
- (_.test (%.symbol (symbol synthesis.branch/if))
- (|> (synthesis.branch/if [(synthesis.bit verdict)
- (synthesis.f64 on_true)
- (synthesis.f64 on_false)])
- (run "if_spec")
- (verify (if verdict on_true on_false))))))
+ (_.property (%.symbol (symbol synthesis.branch/if))
+ (|> (synthesis.branch/if [(synthesis.bit verdict)
+ (synthesis.f64 on_true)
+ (synthesis.f64 on_false)])
+ (run "if_spec")
+ (verify (if verdict on_true on_false))))))
(def: (case_spec run)
(-> Runner Test)
@@ -127,16 +127,16 @@
[[inputS pathS] ..case
on_success r.safe_frac
on_failure (|> r.safe_frac (r.only (|>> (f.= on_success) not)))]
- (_.test (%.symbol (symbol synthesis.branch/case))
- (|> (synthesis.branch/case
- [inputS
- (all synthesis.path/alt
- (all synthesis.path/seq
- pathS
- (synthesis.path/then (synthesis.f64 on_success)))
- (synthesis.path/then (synthesis.f64 on_failure)))])
- (run "case_spec")
- (verify on_success)))))
+ (_.property (%.symbol (symbol synthesis.branch/case))
+ (|> (synthesis.branch/case
+ [inputS
+ (all synthesis.path/alt
+ (all synthesis.path/seq
+ pathS
+ (synthesis.path/then (synthesis.f64 on_success)))
+ (synthesis.path/then (synthesis.f64 on_failure)))])
+ (run "case_spec")
+ (verify on_success)))))
(def: special_input
Synthesis
@@ -243,39 +243,39 @@
(def: (special_spec run)
(-> Runner Test)
(all _.and
- (_.test "==="
- (and (text#= (synthesis.%path special_path)
- (synthesis.%path special_pattern_path))
- (# synthesis.path_equivalence = special_path special_pattern_path)))
- (_.test "CODE"
- (|> special_input
- (run "special_input")
- (pipe.case
- {try.#Success output}
- true
-
- {try.#Failure _}
- false)))
- (_.test "PATTERN_MATCHING 0"
- (|> (synthesis.branch/case [special_input
- special_path])
- (run "special_path")
- (pipe.case
- {try.#Success output}
- true
-
- {try.#Failure _}
- false)))
- (_.test "PATTERN_MATCHING 1"
- (|> (synthesis.branch/case [special_input
- special_pattern_path])
- (run "special_pattern_path")
- (pipe.case
- {try.#Success output}
- true
-
- {try.#Failure _}
- false)))
+ (_.property "==="
+ (and (text#= (synthesis.%path special_path)
+ (synthesis.%path special_pattern_path))
+ (# synthesis.path_equivalence = special_path special_pattern_path)))
+ (_.property "CODE"
+ (|> special_input
+ (run "special_input")
+ (pipe.case
+ {try.#Success output}
+ true
+
+ {try.#Failure _}
+ false)))
+ (_.property "PATTERN_MATCHING 0"
+ (|> (synthesis.branch/case [special_input
+ special_path])
+ (run "special_path")
+ (pipe.case
+ {try.#Success output}
+ true
+
+ {try.#Failure _}
+ false)))
+ (_.property "PATTERN_MATCHING 1"
+ (|> (synthesis.branch/case [special_input
+ special_pattern_path])
+ (run "special_pattern_path")
+ (pipe.case
+ {try.#Success output}
+ true
+
+ {try.#Failure _}
+ false)))
))
(def: .public (spec run)