From 63624fd6b7f9f2563898655472025020483d398f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 9 Nov 2017 14:19:54 -0400 Subject: - Fixed the tests. - Fixed a few bugs. - Can now translate recursion. --- .../test/luxc/lang/analysis/procedure/common.lux | 4 +- .../luxc/lang/translation/procedure/common.jvm.lux | 114 ++++++++++----------- 2 files changed, 59 insertions(+), 59 deletions(-) (limited to 'new-luxc/test') 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 - [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 @@ (test "bit shift-right" (|> (do meta;Monad - [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 [ ] [(test @@ -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 [ ] [(test @@ -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] ) (do-template [ ] [(test @@ -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.=] ) (do-template [ ] [(test @@ -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 @@ -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 @@ -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"))] ) (do-template [ ] [(test @@ -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 @@ -272,7 +272,7 @@ (test "frac encode|decode" (|> (do meta;Monad [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 [ ] [(test @@ -325,7 +325,7 @@ _ false)))] - ["deg to-frac" Frac deg-to-frac f.=] + ["lux deg to-frac" Frac deg-to-frac f.=] )) (~~ (do-template [ ] [(test @@ -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 [ ] [(test @@ -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.=] )) ))))) -- cgit v1.2.3