aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/spec/compositor/generation/case.lux8
-rw-r--r--stdlib/source/spec/compositor/generation/common.lux24
-rw-r--r--stdlib/source/spec/compositor/generation/primitive.lux10
-rw-r--r--stdlib/source/spec/compositor/generation/reference.lux7
4 files changed, 28 insertions, 21 deletions
diff --git a/stdlib/source/spec/compositor/generation/case.lux b/stdlib/source/spec/compositor/generation/case.lux
index 43069bcb4..00a5e4d7c 100644
--- a/stdlib/source/spec/compositor/generation/case.lux
+++ b/stdlib/source/spec/compositor/generation/case.lux
@@ -9,6 +9,8 @@
[data
["." text ("#@." equivalence)
["%" format (#+ format)]]
+ [number
+ ["f" frac]]
[collection
["." list ("#@." fold)]]]
[math
@@ -38,7 +40,7 @@
(def: #export (verify expected)
(-> Frac (Try Any) Bit)
(|>> (case> (#try.Success actual)
- (f/= expected (:coerce Frac actual))
+ (f.= expected (:coerce Frac actual))
(#try.Failure _)
false)))
@@ -108,7 +110,7 @@
(-> Runner Test)
(do r.monad
[on-true r.safe-frac
- on-false (|> r.safe-frac (r.filter (|>> (f/= on-true) not)))
+ on-false (|> r.safe-frac (r.filter (|>> (f.= on-true) not)))
verdict r.bit]
(_.test (%.name (name-of synthesis.branch/if))
(|> (synthesis.branch/if [(synthesis.bit verdict)
@@ -122,7 +124,7 @@
(do r.monad
[[inputS pathS] ..case
on-success r.safe-frac
- on-failure (|> r.safe-frac (r.filter (|>> (f/= on-success) not)))]
+ on-failure (|> r.safe-frac (r.filter (|>> (f.= on-success) not)))]
(_.test (%.name (name-of synthesis.branch/case))
(|> (synthesis.branch/case
[inputS
diff --git a/stdlib/source/spec/compositor/generation/common.lux b/stdlib/source/spec/compositor/generation/common.lux
index f10f2a2ef..e2e6199d9 100644
--- a/stdlib/source/spec/compositor/generation/common.lux
+++ b/stdlib/source/spec/compositor/generation/common.lux
@@ -9,7 +9,9 @@
[data
["." bit ("#@." equivalence)]
[number
- ["." i64]]
+ ["." i64]
+ ["." int]
+ ["f" frac]]
["." text ("#@." equivalence)
["%" format (#+ format)]]
[collection
@@ -86,7 +88,7 @@
false)
(let [subject <subject-expr>])))]
- ["lux i64 f64" Frac int-to-frac f/= subject]
+ ["lux i64 f64" Frac int.frac f.= subject]
["lux i64 char" Text (|>> (:coerce Nat) text.from-code) text@= (|> subject
(:coerce Nat)
(n/% (i64.left-shift 8 1))
@@ -115,12 +117,12 @@
(def: simple-frac
(Random Frac)
- (|> r.nat (:: r.monad map (|>> (n/% 1000) .int int-to-frac))))
+ (|> r.nat (:: r.monad map (|>> (n/% 1000) .int int.frac))))
(def: (f64 run)
(-> Runner Test)
(do r.monad
- [param (|> ..simple-frac (r.filter (|>> (f/= +0.0) not)))
+ [param (|> ..simple-frac (r.filter (|>> (f.= +0.0) not)))
subject ..simple-frac]
(`` ($_ _.and
(~~ (template [<extension> <reference> <comp>]
@@ -130,11 +132,11 @@
(run (..sanitize <extension>))
(//case.verify (<reference> param subject))))]
- ["lux f64 +" f/+ f/=]
- ["lux f64 -" f/- f/=]
- ["lux f64 *" f/* f/=]
- ["lux f64 /" f// f/=]
- ["lux f64 %" f/% f/=]
+ ["lux f64 +" f.+ f.=]
+ ["lux f64 -" f.- f.=]
+ ["lux f64 *" f.* f.=]
+ ["lux f64 /" f./ f.=]
+ ["lux f64 %" f.% f.=]
))
(~~ (template [<extension> <text>]
[(_.test <extension>
@@ -148,8 +150,8 @@
_
false)))]
- ["lux f64 =" f/=]
- ["lux f64 <" f/<]
+ ["lux f64 =" f.=]
+ ["lux f64 <" f.<]
))
(~~ (template [<extension> <reference>]
[(_.test <extension>
diff --git a/stdlib/source/spec/compositor/generation/primitive.lux b/stdlib/source/spec/compositor/generation/primitive.lux
index e3068a50a..e5b601677 100644
--- a/stdlib/source/spec/compositor/generation/primitive.lux
+++ b/stdlib/source/spec/compositor/generation/primitive.lux
@@ -9,7 +9,7 @@
[data
["." bit ("#@." equivalence)]
[number
- ["." frac]]
+ ["f" frac]]
["." text ("#@." equivalence)
["%" format (#+ format)]]]
[math
@@ -22,9 +22,9 @@
(def: (f/=' reference subject)
(-> Frac Frac Bit)
- (or (f/= reference subject)
- (and (frac.not-a-number? reference)
- (frac.not-a-number? subject))))
+ (or (f.= reference subject)
+ (and (f.not-a-number? reference)
+ (f.not-a-number? subject))))
(def: #export (spec run)
(-> Runner Test)
@@ -42,7 +42,7 @@
["bit" synthesis.bit r.bit bit@=]
["i64" synthesis.i64 r.i64 "lux i64 ="]
- ["f64" synthesis.f64 r.frac f/=']
+ ["f64" synthesis.f64 r.frac f.=']
["text" synthesis.text (r.ascii 5) text@=]
))
)))
diff --git a/stdlib/source/spec/compositor/generation/reference.lux b/stdlib/source/spec/compositor/generation/reference.lux
index eb5e3bf92..a5e75b590 100644
--- a/stdlib/source/spec/compositor/generation/reference.lux
+++ b/stdlib/source/spec/compositor/generation/reference.lux
@@ -6,6 +6,9 @@
[control
[pipe (#+ case>)]
["." try]]
+ [data
+ [number
+ ["f" frac]]]
[tool
[compiler
["." reference]
@@ -28,7 +31,7 @@
(_.test "Definitions."
(|> (define name (synthesis.f64 expected))
(case> (#try.Success actual)
- (f/= expected (:coerce Frac actual))
+ (f.= expected (:coerce Frac actual))
(#try.Failure _)
false)))))
@@ -44,7 +47,7 @@
(synthesis.variable/local register)])
(run "variable")
(case> (#try.Success actual)
- (f/= expected (:coerce Frac actual))
+ (f.= expected (:coerce Frac actual))
(#try.Failure _)
false)))))