aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
authorEduardo Julian2018-07-03 18:40:16 -0400
committerEduardo Julian2018-07-03 18:40:16 -0400
commitd3f5e1f4baa667bc2eb72edd542cf5d8cd3924ce (patch)
tree2aa771401cce0d08276abc072b9d31e00a651f29 /new-luxc/test
parentbfd2d6c203042dfddb0ce29db3696365fe213314 (diff)
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/test')
-rw-r--r--new-luxc/test/test/luxc/lang/translation/case.lux4
-rw-r--r--new-luxc/test/test/luxc/lang/translation/common.lux122
-rw-r--r--new-luxc/test/test/luxc/lang/translation/function.lux54
-rw-r--r--new-luxc/test/test/luxc/lang/translation/js.lux20
-rw-r--r--new-luxc/test/test/luxc/lang/translation/jvm.lux50
-rw-r--r--new-luxc/test/test/luxc/lang/translation/primitive.lux2
-rw-r--r--new-luxc/test/test/luxc/lang/translation/reference.lux4
-rw-r--r--new-luxc/test/test/luxc/lang/translation/structure.lux16
8 files changed, 136 insertions, 136 deletions
diff --git a/new-luxc/test/test/luxc/lang/translation/case.lux b/new-luxc/test/test/luxc/lang/translation/case.lux
index f7df17c42..a16715729 100644
--- a/new-luxc/test/test/luxc/lang/translation/case.lux
+++ b/new-luxc/test/test/luxc/lang/translation/case.lux
@@ -74,7 +74,7 @@
("lux case seq" ("lux case bind" +0)
("lux case exec" false))))))
(case> (#e.Success valueT)
- (:! Bool valueT)
+ (:coerce Bool valueT)
(#e.Error error)
(exec (log! error)
@@ -84,7 +84,7 @@
("lux case seq" ("lux case bind" +0)
("lux case exec" (0))))))
(case> (#e.Success valueT)
- (n/= to-bind (:! Nat valueT))
+ (n/= to-bind (:coerce Nat valueT))
(#e.Error error)
(exec (log! error)
diff --git a/new-luxc/test/test/luxc/lang/translation/common.lux b/new-luxc/test/test/luxc/lang/translation/common.lux
index 05a1d069f..793abd4d5 100644
--- a/new-luxc/test/test/luxc/lang/translation/common.lux
+++ b/new-luxc/test/test/luxc/lang/translation/common.lux
@@ -30,7 +30,7 @@
(|> (run (` (<name> (~ (code.nat subject))
(~ (code.nat param)))))
(case> (#e.Success valueT)
- (n/= (<reference> param subject) (:! Nat valueT))
+ (n/= (<reference> param subject) (:coerce Nat valueT))
(#e.Error error)
(exec (log! error)
@@ -51,7 +51,7 @@
(~ (code.nat param)))))
(case> (#e.Success valueT)
(i/= (bit.arithmetic-right-shift param (nat-to-int subject))
- (:! Int valueT))
+ (:coerce Int valueT))
(#e.Error error)
(exec (log! error)
@@ -71,7 +71,7 @@
[(test <name>
(|> (run (` (<name>)))
(case> (#e.Success valueT)
- (i/= <reference> (:! Int valueT))
+ (i/= <reference> (:coerce Int valueT))
(#e.Error error)
(exec (log! error)
@@ -84,7 +84,7 @@
[(test <name>
(|> (run (` (<name> (~ (code.int subject)))))
(case> (#e.Success valueT)
- (<comp> (<prepare> subject) (:! <type> valueT))
+ (<comp> (<prepare> subject) (:coerce <type> valueT))
(#e.Error error)
(exec (log! error)
@@ -92,17 +92,17 @@
(let [subject <subject-expr>])))]
["lux int to-frac" Frac int-to-frac f/= subject]
- ["lux int char" Text (|>> (:! Nat) text.from-code) text/= (|> subject
- (:! Nat)
- (n/% (bit.left-shift +8 +1))
- (:! Int))]
+ ["lux int char" Text (|>> (:coerce Nat) text.from-code) text/= (|> subject
+ (:coerce Nat)
+ (n/% (bit.left-shift +8 +1))
+ (:coerce Int))]
))
(~~ (do-template [<name> <reference> <outputT> <comp>]
[(test <name>
(exec (log! <name>)
(|> (run (` (<name> (~ (code.int subject)) (~ (code.int param)))))
(case> (#e.Success valueT)
- (<comp> (<reference> param subject) (:! <outputT> valueT))
+ (<comp> (<reference> param subject) (:coerce <outputT> valueT))
(#e.Error error)
(exec (log! error)
@@ -127,7 +127,7 @@
[(test <name>
(|> (run (` (<name> (~ (code.frac subject)) (~ (code.frac param)))))
(case> (#e.Success valueT)
- (<comp> (<reference> param subject) (:! <outputT> valueT))
+ (<comp> (<reference> param subject) (:coerce <outputT> valueT))
_
false)))]
@@ -153,7 +153,7 @@
[(test <name>
(|> (run (` (<name>)))
(case> (#e.Success valueT)
- (<test> (:! Frac valueT))
+ (<test> (:coerce Frac valueT))
_
false)))]
@@ -169,7 +169,7 @@
[(test <forward>
(|> (run (` (<backward> (<forward> (~ (code.frac subject))))))
(case> (#e.Success valueT)
- (|> valueT (:! Frac) (f/- subject) frac/abs <test>)
+ (|> valueT (:coerce Frac) (f/- subject) frac/abs <test>)
(#e.Error error)
(exec (log! error)
@@ -218,48 +218,48 @@
(test "Can compare texts for equality."
(and (|> (run (` ("lux text =" (~ sample0S) (~ sample0S))))
(case> (#e.Success valueV)
- (:! Bool valueV)
+ (:coerce Bool valueV)
_
false))
(|> (run (` ("lux text =" (~ sample0S) (~ sample1S))))
(case> (#e.Success valueV)
- (not (:! Bool valueV))
+ (not (:coerce Bool valueV))
_
false))))
(test "Can compare texts for order."
(|> (run (` ("lux text <" (~ sample1S) (~ sample0S))))
(case> (#e.Success valueV)
- (:! Bool valueV)
+ (:coerce Bool valueV)
_
false)))
(test "Can get length of text."
(|> (run (` ("lux text size" (~ sample0S))))
(case> (#e.Success valueV)
- (n/= sample-size (:! Nat valueV))
+ (n/= sample-size (:coerce Nat valueV))
_
false)))
(test "Can concatenate text."
(|> (run (` ("lux text size" (~ concatenatedS))))
(case> (#e.Success valueV)
- (n/= (n/* +2 sample-size) (:! Nat valueV))
+ (n/= (n/* +2 sample-size) (:coerce Nat valueV))
_
false)))
(test "Can find index of sub-text."
(and (|> (run (` ("lux text index" (~ concatenatedS) (~ sample0S) +0)))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Nat) valueV) (#.Some valueV)])
+ [(:coerce (Maybe Nat) valueV) (#.Some valueV)])
(n/= +0 valueV)
_
false))
(|> (run (` ("lux text index" (~ concatenatedS) (~ sample1S) +0)))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Nat) valueV) (#.Some valueV)])
+ [(:coerce (Maybe Nat) valueV) (#.Some valueV)])
(n/= sample-size valueV)
_
@@ -269,7 +269,7 @@
("lux text hash" (~ sample0S))
("lux text hash" (~ sample0S)))))
(case> (#e.Success valueV)
- (:! Bool valueV)
+ (:coerce Bool valueV)
(#e.Error error)
(exec (log! error)
@@ -282,7 +282,7 @@
(~ sample1S)
(~ sample2S)))))
(case> (#e.Success valueV)
- (:! Bool valueV)
+ (:coerce Bool valueV)
(#e.Error error)
(exec (log! error)
@@ -295,7 +295,7 @@
(~ sample1S)
(~ sample2S)))))
(case> (#e.Success valueV)
- (:! Bool valueV)
+ (:coerce Bool valueV)
(#e.Error error)
(exec (log! error)
@@ -306,7 +306,7 @@
(~ (code.nat from))
(~ (code.nat to)))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Text) valueV) (#.Some valueV)])
+ [(:coerce (Maybe Text) valueV) (#.Some valueV)])
(text/= expected valueV)
_
@@ -319,7 +319,7 @@
(~ sample0S)
(~ (code.nat char-idx)))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Int) valueV) (#.Some valueV)])
+ [(:coerce (Maybe Int) valueV) (#.Some valueV)])
(text.contains? ("lux int char" valueV)
sample0)
@@ -339,7 +339,7 @@
(test "Can get size of array."
(|> (run (` ("lux array size" (~ array0S))))
(case> (#e.Success valueV)
- (n/= size (:! Nat valueV))
+ (n/= size (:coerce Nat valueV))
(#e.Error error)
(exec (log! error)
@@ -347,14 +347,14 @@
(test "Can get element from array (if it exists)."
(and (|> (run (` ("lux array get" (~ array0S) (~ (code.nat idx)))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Nat) valueV) #.None])
+ [(:coerce (Maybe Nat) valueV) #.None])
true
_
false))
(|> (run (` ("lux array get" (~ array1S) (~ (code.nat idx)))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Nat) valueV) (#.Some valueV)])
+ [(:coerce (Maybe Nat) valueV) (#.Some valueV)])
(n/= value valueV)
_
@@ -365,7 +365,7 @@
(~ (code.nat idx)))
(~ (code.nat idx)))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Nat) valueV) #.None])
+ [(:coerce (Maybe Nat) valueV) #.None])
true
_
@@ -428,7 +428,7 @@
(and (|> (run (` ("lux try" ("lux function" +1 []
("lux io error" (~ (code.text message)))))))
(case> (^multi (#e.Success valueV)
- [(:! (e.Error Text) valueV) (#e.Error error)])
+ [(:coerce (e.Error Text) valueV) (#e.Error error)])
(text.contains? message error)
_
@@ -436,7 +436,7 @@
(|> (run (` ("lux try" ("lux function" +1 []
(~ (code.text message))))))
(case> (^multi (#e.Success valueV)
- [(:! (e.Error Text) valueV) (#e.Success valueV)])
+ [(:coerce (e.Error Text) valueV) (#e.Success valueV)])
(text/= message valueV)
_
@@ -444,7 +444,7 @@
(test "Can obtain current time in milli-seconds."
(|> (run (` [("lux io current-time") ("lux io current-time")]))
(case> (#e.Success valueV)
- (let [[pre post] (:! [Nat Nat] valueV)]
+ (let [[pre post] (:coerce [Nat Nat] valueV)]
(n/>= pre post))
(#e.Error error)
@@ -464,7 +464,7 @@
(test "Can read atoms."
(|> (run (` ("lux atom read" (~ atomS))))
(case> (#e.Success valueV)
- (n/= pre (:! Nat valueV))
+ (n/= pre (:coerce Nat valueV))
(#e.Error error)
(exec (log! error)
@@ -475,7 +475,7 @@
[("lux atom compare-and-swap" (1) (0) (~ postS))
("lux atom read" (1))]))))
(case> (#e.Success valueV)
- (let [[swapped? current-value] (:! [Bool Nat] valueV)]
+ (let [[swapped? current-value] (:coerce [Bool Nat] valueV)]
(and swapped?
(n/= post current-value)))
@@ -487,7 +487,7 @@
[("lux atom compare-and-swap" (1) (~ postS) (~ postS))
("lux atom read" (1))]))))
(case> (#e.Success valueV)
- (let [[swapped? current-value] (:! [Bool Nat] valueV)]
+ (let [[swapped? current-value] (:coerce [Bool Nat] valueV)]
(and (not swapped?)
(n/= pre current-value)))
@@ -508,7 +508,7 @@
(test "Can read boxes."
(|> (run (` ("lux box read" (~ boxS))))
(case> (#e.Success valueV)
- (n/= pre (:! Nat valueV))
+ (n/= pre (:coerce Nat valueV))
(#e.Error error)
(exec (log! error)
@@ -518,7 +518,7 @@
("lux let" +1 ("lux box write" (~ postS) (0))
("lux box read" (0))))))
(case> (#e.Success valueV)
- (n/= post (:! Nat valueV))
+ (n/= post (:coerce Nat valueV))
(#e.Error error)
(exec (log! error)
@@ -531,7 +531,7 @@
(test "Can query the concurrency level of the machine."
(|> (run (` ("lux process parallelism-level")))
(case> (#e.Success valueV)
- (n/>= +1 (:! Nat valueV))
+ (n/>= +1 (:coerce Nat valueV))
(#e.Error error)
(exec (log! error)
@@ -571,34 +571,34 @@
(<| (times +100)
(all-specs run-jvm)))
-(context: "[JS] Common procedures."
- (<| (times +100)
- (all-specs run-js)))
+## (context: "[JS] Common procedures."
+## (<| (times +100)
+## (all-specs run-js)))
-(context: "[Lua] Common procedures."
- (<| (times +100)
- (all-specs run-lua)))
+## (context: "[Lua] Common procedures."
+## (<| (times +100)
+## (all-specs run-lua)))
-(context: "[Ruby] Common procedures."
- (<| (times +100)
- (all-specs run-ruby)))
+## (context: "[Ruby] Common procedures."
+## (<| (times +100)
+## (all-specs run-ruby)))
-(context: "[Python] Common procedures."
- (<| (times +100)
- (all-specs run-python)))
+## (context: "[Python] Common procedures."
+## (<| (times +100)
+## (all-specs run-python)))
-(context: "[R] Common procedures."
- (<| (times +100)
- (all-specs run-r)))
+## (context: "[R] Common procedures."
+## (<| (times +100)
+## (all-specs run-r)))
-(context: "[Scheme] Common procedures."
- (<| (times +100)
- (all-specs run-scheme)))
+## (context: "[Scheme] Common procedures."
+## (<| (times +100)
+## (all-specs run-scheme)))
-(context: "[Common Lisp] Common procedures."
- (<| (times +100)
- (all-specs run-common-lisp)))
+## (context: "[Common Lisp] Common procedures."
+## (<| (times +100)
+## (all-specs run-common-lisp)))
-(context: "[PHP] Common procedures."
- (<| (times +100)
- (all-specs run-php)))
+## (context: "[PHP] Common procedures."
+## (<| (times +100)
+## (all-specs run-php)))
diff --git a/new-luxc/test/test/luxc/lang/translation/function.lux b/new-luxc/test/test/luxc/lang/translation/function.lux
index 69cd174dd..fd96aeeb9 100644
--- a/new-luxc/test/test/luxc/lang/translation/function.lux
+++ b/new-luxc/test/test/luxc/lang/translation/function.lux
@@ -51,7 +51,7 @@
(test "Can read arguments."
(|> (run (` ("lux call" (~ functionS) (~+ argsS))))
(case> (#e.Success valueT)
- (f/= arg-value (:! Frac valueT))
+ (f/= arg-value (:coerce Frac valueT))
(#e.Error error)
(exec (log! error)
@@ -65,7 +65,7 @@
("lux call" (~ functionS) (~+ preS))
(~+ postS))))
(case> (#e.Success valueT)
- (f/= arg-value (:! Frac valueT))
+ (f/= arg-value (:coerce Frac valueT))
(#e.Error error)
(exec (log! error)
@@ -84,7 +84,7 @@
((~ (code.int arg-var))))))]
(|> (run (` ("lux call" (~ functionS) (~+ argsS))))
(case> (#e.Success valueT)
- (f/= arg-value (:! Frac valueT))
+ (f/= arg-value (:coerce Frac valueT))
(#e.Error error)
(exec (log! error)
@@ -95,34 +95,34 @@
(<| (times +100)
(function-spec run-jvm)))
-(context: "[JS] Function."
- (<| (times +100)
- (function-spec run-js)))
+## (context: "[JS] Function."
+## (<| (times +100)
+## (function-spec run-js)))
-(context: "[Lua] Function."
- (<| (times +100)
- (function-spec run-lua)))
+## (context: "[Lua] Function."
+## (<| (times +100)
+## (function-spec run-lua)))
-(context: "[Ruby] Function."
- (<| (times +100)
- (function-spec run-ruby)))
+## (context: "[Ruby] Function."
+## (<| (times +100)
+## (function-spec run-ruby)))
-(context: "[Python] Function."
- (<| (times +100)
- (function-spec run-python)))
+## (context: "[Python] Function."
+## (<| (times +100)
+## (function-spec run-python)))
-(context: "[R] Function."
- (<| (times +100)
- (function-spec run-r)))
+## (context: "[R] Function."
+## (<| (times +100)
+## (function-spec run-r)))
-(context: "[Scheme] Function."
- (<| (times +100)
- (function-spec run-scheme)))
+## (context: "[Scheme] Function."
+## (<| (times +100)
+## (function-spec run-scheme)))
-(context: "[Common Lisp] Function."
- (<| (times +100)
- (function-spec run-common-lisp)))
+## (context: "[Common Lisp] Function."
+## (<| (times +100)
+## (function-spec run-common-lisp)))
-(context: "[PHP] Function."
- (<| (times +100)
- (function-spec run-php)))
+## (context: "[PHP] Function."
+## (<| (times +100)
+## (function-spec run-php)))
diff --git a/new-luxc/test/test/luxc/lang/translation/js.lux b/new-luxc/test/test/luxc/lang/translation/js.lux
index e6443cce8..6f4fb572d 100644
--- a/new-luxc/test/test/luxc/lang/translation/js.lux
+++ b/new-luxc/test/test/luxc/lang/translation/js.lux
@@ -23,7 +23,7 @@
(-> Synthesis Bool)
(|> (run-js (` ("lux is" (~ synthesis) (~ synthesis))))
(case> (#e.Success valueV)
- (:! Bool valueV)
+ (:coerce Bool valueV)
_
false)))
@@ -34,7 +34,7 @@
[(def: (<name> angle)
(-> <type> Check)
(|>> (case> (#e.Success valueV)
- (<=> (<pre> angle) (:! <type> valueV))
+ (<=> (<pre> angle) (:coerce <type> valueV))
(#e.Error error)
false)))]
@@ -74,7 +74,7 @@
(test "Cannot get non-existing fields from objects."
(|> (run-js (` ("js object get" (~ field) (~ empty-object))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Int) valueV) #.None])
+ [(:coerce (Maybe Int) valueV) #.None])
true
_
@@ -82,8 +82,8 @@
(test "Can get fields from objects."
(|> (run-js (` ("js object get" (~ field) (~ object))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Int) valueV) (#.Some valueV)])
- (i/= value (:! Int valueV))
+ [(:coerce (Maybe Int) valueV) (#.Some valueV)])
+ (i/= value (:coerce Int valueV))
_
false)))
@@ -91,7 +91,7 @@
(|> (run-js (let [post-delete (` ("js object delete" (~ field) (~ object)))]
(` ("js object get" (~ field) (~ post-delete)))))
(case> (^multi (#e.Success valueV)
- [(:! (Maybe Int) valueV) #.None])
+ [(:coerce (Maybe Int) valueV) #.None])
true
_
@@ -100,7 +100,7 @@
(let [base (` ("js object new" ("js global" "Number") (~ (code.text (%f frac-value)))))]
(|> (run-js (` ("lux frac +" (~ base) 0.0)))
(case> (#e.Success valueV)
- (f/= frac-value (:! Frac valueV))
+ (f/= frac-value (:coerce Frac valueV))
(#e.Error error)
false))))
@@ -125,7 +125,7 @@
(test "Can get an element from an array."
(|> (run-js (` ("js array read" (~ (code.nat idx)) (~ arrayS))))
(case> (^multi (#e.Success elemV)
- [[(list.nth idx elems) (:! (Maybe Nat) elemV)]
+ [[(list.nth idx elems) (:coerce (Maybe Nat) elemV)]
[(#.Some reference) (#.Some sample)]])
(n/= reference sample)
@@ -137,7 +137,7 @@
(|> (run-js (` ("js array read" (~ idxS)
("js array write" (~ idxS) (~ overwriteS) (~ arrayS)))))
(case> (^multi (#e.Success elemV)
- [(:! (Maybe Nat) elemV)
+ [(:coerce (Maybe Nat) elemV)
(#.Some sample)])
(n/= overwrite sample)
@@ -150,7 +150,7 @@
(length-check length))
(|> (run-js (` ("js array read" (~ idxS) (~ deleteS))))
(case> (^multi (#e.Success elemV)
- [(:! (Maybe Nat) elemV)
+ [(:coerce (Maybe Nat) elemV)
#.None])
true
diff --git a/new-luxc/test/test/luxc/lang/translation/jvm.lux b/new-luxc/test/test/luxc/lang/translation/jvm.lux
index a835ce9d4..23877a51e 100644
--- a/new-luxc/test/test/luxc/lang/translation/jvm.lux
+++ b/new-luxc/test/test/luxc/lang/translation/jvm.lux
@@ -37,7 +37,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success valueT)
- (<test> <sample> (:! <cast> valueT))
+ (<test> <sample> (:coerce <cast> valueT))
(#e.Error error)
false)))]
@@ -69,7 +69,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success valueT)
- (<test> <sample> (:! <cast> valueT))
+ (<test> <sample> (:coerce <cast> valueT))
(#e.Error error)
false)))]
@@ -96,7 +96,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success valueT)
- (<test> <sample> (:! <cast> valueT))
+ (<test> <sample> (:coerce <cast> valueT))
(#e.Error error)
false)))]
@@ -138,7 +138,7 @@
(macro.run (io.run init-jvm))
(case> (#e.Success valueT)
(<test> (<reference> param subject)
- (:! <type> valueT))
+ (:coerce <type> valueT))
(#e.Error error)
false)))]
@@ -177,7 +177,7 @@
(macro.run (io.run init-jvm))
(case> (#e.Success valueT)
(n/= (<reference> param subject)
- (:! Nat valueT))
+ (:coerce Nat valueT))
(#e.Error error)
false)))]
@@ -211,7 +211,7 @@
(macro.run (io.run init-jvm))
(case> (#e.Success valueT)
(<test> (<reference> shift (<pre-subject> subject))
- (:! <type> valueT))
+ (:coerce <type> valueT))
(#e.Error error)
false)))]
@@ -243,7 +243,7 @@
(macro.run (io.run init-jvm))
(case> (#e.Success valueT)
(bool/= (<reference> param subject)
- (:! Bool valueT))
+ (:coerce Bool valueT))
(#e.Error error)
false)))]
@@ -300,7 +300,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputZ)
- (<test> <value> (:! <type> outputZ))
+ (<test> <value> (:coerce <type> outputZ))
(#e.Error error)
false)))]
@@ -350,7 +350,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (<test> <value> (:! <type> outputT))
+ (<test> <value> (:coerce <type> outputT))
(#e.Error error)
false)))]
@@ -378,7 +378,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (f/= valueD (:! Frac outputT))
+ (f/= valueD (:coerce Frac outputT))
(#e.Error error)
false)))
@@ -389,7 +389,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (n/= size (:! Nat outputT))
+ (n/= size (:coerce Nat outputT))
(#e.Error error)
false)))
@@ -440,7 +440,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (:! Bool outputT)
+ (:coerce Bool outputT)
(#e.Error error)
false)))
@@ -451,7 +451,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (not (:! Bool outputT))
+ (not (:coerce Bool outputT))
(#e.Error error)
false)))
@@ -462,7 +462,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (i/= sample (:! Int outputT))
+ (i/= sample (:coerce Int outputT))
(#e.Error error)
false)))
@@ -477,7 +477,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (case (:! (e.Error Any) outputT)
+ (case (:coerce (e.Error Any) outputT)
(#e.Error error)
(text.contains? exception-message error)
@@ -493,7 +493,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (|> outputT (:! Class) (Class::getName []) (text/= class))
+ (|> outputT (:coerce Class) (Class::getName []) (text/= class))
(#e.Error error)
false)))
@@ -504,7 +504,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (:! Bool outputT)
+ (:coerce Bool outputT)
(#e.Error error)
false)))
@@ -536,7 +536,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (i/= GregorianCalendar::AD (:! Int outputT))
+ (i/= GregorianCalendar::AD (:coerce Int outputT))
(#e.Error error)
false)))
@@ -548,7 +548,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (is? hostL.unit (:! Text outputT))
+ (is? hostL.unit (:coerce Text outputT))
(#e.Error error)
false)))
@@ -559,7 +559,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (text/= sample-string (:! Text outputT))
+ (text/= sample-string (:coerce Text outputT))
(#e.Error error)
false)))
@@ -572,7 +572,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (text/= other-sample-string (:! Text outputT))
+ (text/= other-sample-string (:coerce Text outputT))
(#e.Error error)
false)))
@@ -601,7 +601,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (i/= sample (:! Int outputT))
+ (i/= sample (:coerce Int outputT))
(#e.Error error)
false)))
@@ -614,7 +614,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (:! Bool outputT)
+ (:coerce Bool outputT)
(#e.Error error)
false)))
@@ -627,7 +627,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (:! Bool outputT)
+ (:coerce Bool outputT)
(#e.Error error)
false)))
@@ -638,7 +638,7 @@
(lang.with-current-module "")
(macro.run (io.run init-jvm))
(case> (#e.Success outputT)
- (host.instance? ArrayList (:! Object outputT))
+ (host.instance? ArrayList (:coerce Object outputT))
(#e.Error error)
false)))
diff --git a/new-luxc/test/test/luxc/lang/translation/primitive.lux b/new-luxc/test/test/luxc/lang/translation/primitive.lux
index 42d78f646..5d368cc60 100644
--- a/new-luxc/test/test/luxc/lang/translation/primitive.lux
+++ b/new-luxc/test/test/luxc/lang/translation/primitive.lux
@@ -27,7 +27,7 @@
[(test (format "Can translate " <desc> ".")
(|> (run (<synthesis> <sample>))
(case> (#e.Success valueT)
- (<test> <sample> (:! <type> valueT))
+ (<test> <sample> (:coerce <type> valueT))
(#e.Error error)
(exec (log! error)
diff --git a/new-luxc/test/test/luxc/lang/translation/reference.lux b/new-luxc/test/test/luxc/lang/translation/reference.lux
index 41032f0c7..17cd78d54 100644
--- a/new-luxc/test/test/luxc/lang/translation/reference.lux
+++ b/new-luxc/test/test/luxc/lang/translation/reference.lux
@@ -35,7 +35,7 @@
(test "Can refer to definitions."
(|> (define def-name (//synthesis.i64 def-value))
(case> (#e.Success valueT)
- (i/= def-value (:! Int valueT))
+ (i/= def-value (:coerce Int valueT))
(#e.Error error)
(exec (log! error)
@@ -51,7 +51,7 @@
register
(//synthesis.variable/local register)]))
(case> (#e.Success outputT)
- (i/= value (:! Int outputT))
+ (i/= value (:coerce Int outputT))
(#e.Error error)
(exec (log! error)
diff --git a/new-luxc/test/test/luxc/lang/translation/structure.lux b/new-luxc/test/test/luxc/lang/translation/structure.lux
index 6e512f3ec..2a757d3a6 100644
--- a/new-luxc/test/test/luxc/lang/translation/structure.lux
+++ b/new-luxc/test/test/luxc/lang/translation/structure.lux
@@ -30,10 +30,10 @@
(test "Can translate tuple."
(|> (run (code.tuple (list/map code.int tuple-in)))
(case> (#e.Success tuple-out)
- (let [tuple-out (:! (Array Any) tuple-out)]
+ (let [tuple-out (:coerce (Array Any) tuple-out)]
(and (n/= size (array.size tuple-out))
(list.every? (function (_ [left right])
- (i/= left (:! Int right)))
+ (i/= left (:coerce Int right)))
(list.zip2 tuple-in (array.to-list tuple-out)))))
(#e.Error error)
@@ -50,19 +50,19 @@
(test "Can translate variant."
(|> (run (` ((~ (code.nat tag-in)) (~ (code.bool last?-in)) (~ (code.int value-in)))))
(case> (#e.Success valueT)
- (let [valueT (:! (Array Any) valueT)]
+ (let [valueT (:coerce (Array Any) valueT)]
(and (n/= +3 (array.size valueT))
- (let [tag-out (:! Integer (maybe.assume (array.read +0 valueT)))
+ (let [tag-out (:coerce Integer (maybe.assume (array.read +0 valueT)))
last?-out (array.read +1 valueT)
- value-out (:! Any (maybe.assume (array.read +2 valueT)))
- same-tag? (n/= tag-in (|> tag-out host.int-to-long (:! Nat)))
+ value-out (:coerce Any (maybe.assume (array.read +2 valueT)))
+ same-tag? (n/= tag-in (|> tag-out host.int-to-long (:coerce Nat)))
same-flag? (case last?-out
(#.Some last?-out')
- (and last?-in (text/= "" (:! Text last?-out')))
+ (and last?-in (text/= "" (:coerce Text last?-out')))
#.None
(not last?-in))
- same-value? (i/= value-in (:! Int value-out))]
+ same-value? (i/= value-in (:coerce Int value-out))]
(and same-tag?
same-flag?
same-value?))))