aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
authorEduardo Julian2017-11-09 14:19:54 -0400
committerEduardo Julian2017-11-09 14:19:54 -0400
commit63624fd6b7f9f2563898655472025020483d398f (patch)
tree8c3f2f3db00203621c86c07699ade7011918705c /new-luxc/test
parent0cb55507c100f6817225e644c2d19e73940edad6 (diff)
- Fixed the tests.
- Fixed a few bugs. - Can now translate recursion.
Diffstat (limited to 'new-luxc/test')
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/procedure/common.lux4
-rw-r--r--new-luxc/test/test/luxc/lang/translation/procedure/common.jvm.lux114
2 files changed, 59 insertions, 59 deletions
diff --git a/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux b/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
index 134421732..b992ca2d6 100644
--- a/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
@@ -230,8 +230,8 @@
(check-success+ "lux text =" (list subjectC paramC) Bool))
(test "Compare texts in lexicographical order."
(check-success+ "lux text <" (list subjectC paramC) Bool))
- (test "Can prepend one text to another."
- (check-success+ "lux text prepend" (list subjectC paramC) Text))
+ (test "Can concatenate one text to another."
+ (check-success+ "lux text concat" (list subjectC paramC) Text))
(test "Can find the index of a piece of text inside a larger one that (may) contain it."
(check-success+ "lux text index" (list subjectC paramC fromC) (type (Maybe Nat))))
(test "Can query the size/length of a text."
diff --git a/new-luxc/test/test/luxc/lang/translation/procedure/common.jvm.lux b/new-luxc/test/test/luxc/lang/translation/procedure/common.jvm.lux
index e15627851..38036e420 100644
--- a/new-luxc/test/test/luxc/lang/translation/procedure/common.jvm.lux
+++ b/new-luxc/test/test/luxc/lang/translation/procedure/common.jvm.lux
@@ -41,16 +41,16 @@
_
false)))]
- ["bit and" bit;and]
- ["bit or" bit;or]
- ["bit xor" bit;xor]
- ["bit shift-left" bit;shift-left]
- ["bit unsigned-shift-right" bit;shift-right]
+ ["lux bit and" bit;and]
+ ["lux bit or" bit;or]
+ ["lux bit xor" bit;xor]
+ ["lux bit shift-left" bit;shift-left]
+ ["lux bit unsigned-shift-right" bit;shift-right]
)]
($_ seq
(test "bit count"
(|> (do meta;Monad<Meta>
- [sampleI (expressionT;translate (` ("bit count" (~ (code;nat subject)))))]
+ [sampleI (expressionT;translate (` ("lux bit count" (~ (code;nat subject)))))]
(@eval;eval sampleI))
(meta;run (init-compiler []))
(case> (#e;Success valueT)
@@ -62,7 +62,7 @@
<binary>
(test "bit shift-right"
(|> (do meta;Monad<Meta>
- [sampleI (expressionT;translate (` ("bit shift-right"
+ [sampleI (expressionT;translate (` ("lux bit shift-right"
(~ (code;int (nat-to-int subject)))
(~ (code;nat param)))))]
(@eval;eval sampleI))
@@ -93,8 +93,8 @@
_
false)))]
- ["nat min" nat/bottom]
- ["nat max" nat/top]
+ ["lux nat min" nat/bottom]
+ ["lux nat max" nat/top]
))
(~~ (do-template [<name> <type> <prepare> <comp>]
[(test <name>
@@ -108,8 +108,8 @@
_
false)))]
- ["nat to-int" Int nat-to-int i.=]
- ["nat to-char" Text text;from-code text/=]
+ ["lux nat to-int" Int nat-to-int i.=]
+ ["lux nat to-char" Text text;from-code text/=]
))
(~~ (do-template [<name> <reference> <outputT> <comp>]
[(test <name>
@@ -124,13 +124,13 @@
_
false)))]
- ["nat +" n.+ Nat n.=]
- ["nat -" n.- Nat n.=]
- ["nat *" n.* Nat n.=]
- ["nat /" n./ Nat n.=]
- ["nat %" n.% Nat n.=]
- ["nat =" n.= Bool bool/=]
- ["nat <" n.< Bool bool/=]
+ ["lux nat +" n.+ Nat n.=]
+ ["lux nat -" n.- Nat n.=]
+ ["lux nat *" n.* Nat n.=]
+ ["lux nat /" n./ Nat n.=]
+ ["lux nat %" n.% Nat n.=]
+ ["lux nat =" n.= Bool bool/=]
+ ["lux nat <" n.< Bool bool/=]
))
)))))
@@ -151,8 +151,8 @@
_
false)))]
- ["int min" int/bottom]
- ["int max" int/top]
+ ["lux int min" int/bottom]
+ ["lux int max" int/top]
)
<unary> (do-template [<name> <type> <prepare> <comp>]
[(test <name>
@@ -166,8 +166,8 @@
_
false)))]
- ["int to-nat" Nat int-to-nat n.=]
- ["int to-frac" Frac int-to-frac f.=]
+ ["lux int to-nat" Nat int-to-nat n.=]
+ ["lux int to-frac" Frac int-to-frac f.=]
)
<binary> (do-template [<name> <reference> <outputT> <comp>]
[(test <name>
@@ -182,13 +182,13 @@
_
false)))]
- ["int +" i.+ Int i.=]
- ["int -" i.- Int i.=]
- ["int *" i.* Int i.=]
- ["int /" i./ Int i.=]
- ["int %" i.% Int i.=]
- ["int =" i.= Bool bool/=]
- ["int <" i.< Bool bool/=]
+ ["lux int +" i.+ Int i.=]
+ ["lux int -" i.- Int i.=]
+ ["lux int *" i.* Int i.=]
+ ["lux int /" i./ Int i.=]
+ ["lux int %" i.% Int i.=]
+ ["lux int =" i.= Bool bool/=]
+ ["lux int <" i.< Bool bool/=]
)]
($_ seq
<nullary>
@@ -214,13 +214,13 @@
_
false)))]
- ["frac +" f.+ Frac f.=]
- ["frac -" f.- Frac f.=]
- ["frac *" f.* Frac f.=]
- ["frac /" f./ Frac f.=]
- ["frac %" f.% Frac f.=]
- ["frac =" f.= Bool bool/=]
- ["frac <" f.< Bool bool/=]
+ ["lux frac +" f.+ Frac f.=]
+ ["lux frac -" f.- Frac f.=]
+ ["lux frac *" f.* Frac f.=]
+ ["lux frac /" f./ Frac f.=]
+ ["lux frac %" f.% Frac f.=]
+ ["lux frac =" f.= Bool bool/=]
+ ["lux frac <" f.< Bool bool/=]
)]
($_ seq
<binary>
@@ -243,12 +243,12 @@
_
false)))]
- ["frac min" (f.= real/bottom)]
- ["frac max" (f.= real/top)]
- ["frac not-a-number" number;not-a-number?]
- ["frac positive-infinity" (f.= number;positive-infinity)]
- ["frac negative-infinity" (f.= number;negative-infinity)]
- ["frac smallest" (f.= (_lux_proc [ "frac" "smallest-value"] []))]
+ ["lux frac min" (f.= real/bottom)]
+ ["lux frac max" (f.= real/top)]
+ ["lux frac not-a-number" number;not-a-number?]
+ ["lux frac positive-infinity" (f.= number;positive-infinity)]
+ ["lux frac negative-infinity" (f.= number;negative-infinity)]
+ ["lux frac smallest" (f.= ("lux frac smallest-value"))]
)
<unary> (do-template [<name> <type> <prepare> <comp>]
[(test <name>
@@ -263,8 +263,8 @@
_
false)))]
- ["frac to-int" Int frac-to-int i.=]
- ["frac to-deg" Deg frac-to-deg d.=]
+ ["lux frac to-int" Int frac-to-int i.=]
+ ["lux frac to-deg" Deg frac-to-deg d.=]
)]
($_ seq
<nullary>
@@ -272,7 +272,7 @@
(test "frac encode|decode"
(|> (do meta;Monad<Meta>
[runtime-bytecode @runtime;translate
- sampleI (expressionT;translate (` ("frac decode" ("frac encode" (~ (code;frac subject))))))]
+ sampleI (expressionT;translate (` ("lux frac decode" ("lux frac encode" (~ (code;frac subject))))))]
(@eval;eval sampleI))
(meta;run (init-compiler []))
(case> (^multi (#e;Success valueT)
@@ -309,8 +309,8 @@
_
false)))]
- ["deg min" deg/bottom]
- ["deg max" deg/top]
+ ["lux deg min" deg/bottom]
+ ["lux deg max" deg/top]
))
(~~ (do-template [<name> <type> <prepare> <comp>]
[(test <name>
@@ -325,7 +325,7 @@
_
false)))]
- ["deg to-frac" Frac deg-to-frac f.=]
+ ["lux deg to-frac" Frac deg-to-frac f.=]
))
(~~ (do-template [<name> <reference> <outputT> <comp>]
[(test <name>
@@ -340,13 +340,13 @@
_
false)))]
- ["deg +" d.+ Deg d.=]
- ["deg -" d.- Deg d.=]
- ["deg *" d.* Deg d.=]
- ["deg /" d./ Deg d.=]
- ["deg %" d.% Deg d.=]
- ["deg =" d.= Bool bool/=]
- ["deg <" d.< Bool bool/=]
+ ["lux deg +" d.+ Deg d.=]
+ ["lux deg -" d.- Deg d.=]
+ ["lux deg *" d.* Deg d.=]
+ ["lux deg /" d./ Deg d.=]
+ ["lux deg %" d.% Deg d.=]
+ ["lux deg =" d.= Bool bool/=]
+ ["lux deg <" d.< Bool bool/=]
))
(~~ (do-template [<name> <reference> <outputT> <comp>]
[(test <name>
@@ -361,7 +361,7 @@
_
false)))]
- ["deg scale" d.scale Deg d.=]
- ["deg reciprocal" d.reciprocal Deg d.=]
+ ["lux deg scale" d.scale Deg d.=]
+ ["lux deg reciprocal" d.reciprocal Deg d.=]
))
)))))