diff options
author | Eduardo Julian | 2021-08-11 02:38:59 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-11 02:38:59 -0400 |
commit | a62ce3f9c2b605e0033f4772b0f64c4525de4d86 (patch) | |
tree | ecbabe8f110d82b2e6481cf7c0532d4bd4386570 /lux-jvm/test | |
parent | 464b6e8f5e6c62f58fa8c7ff61ab2ad215e98bd1 (diff) |
Relocated maybe and lazy from data to control.
Diffstat (limited to 'lux-jvm/test')
-rw-r--r-- | lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux | 8 | ||||
-rw-r--r-- | lux-jvm/test/test/luxc/lang/synthesis/procedure.lux | 2 | ||||
-rw-r--r-- | lux-jvm/test/test/luxc/lang/translation/jvm.lux | 142 |
3 files changed, 76 insertions, 76 deletions
diff --git a/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux b/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux index aad3955cf..ae3b84518 100644 --- a/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux +++ b/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux @@ -1,12 +1,12 @@ (.module: [lux #* [control + pipe [monad (#+ do)] - pipe] + ["." maybe]] [data ["e" error] ["." product] - ["." maybe] [text ("text/" Equivalence<Text>) format] [collection @@ -41,7 +41,7 @@ (typeA.with-type output-type (_primitive.analyse (` ((~ (code.text procedure)) (~+ params))))))) (analysis.with-current-module "") - (macro.run (initL.compiler [])) + (macro.result (initL.compiler [])) (case> (#e.Success _) <success> @@ -62,7 +62,7 @@ (typeA.with-type output-type (_primitive.analyse syntax)))) (analysis.with-current-module "") - (macro.run (initL.compiler [])) + (macro.result (initL.compiler [])) (case> (#e.Success _) <success> diff --git a/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux b/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux index ab6c9de6f..2c4c5f599 100644 --- a/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux +++ b/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux @@ -26,7 +26,7 @@ (la.procedure nameA argsA)) (case> (^ [_ (#.Form (list& [_ (#.Text procedure)] argsS))]) (and (text/= nameA procedure) - (list.every? (product.uncurry corresponds?) + (list.every? (product.uncurried corresponds?) (list.zip2 argsA argsS))) _ diff --git a/lux-jvm/test/test/luxc/lang/translation/jvm.lux b/lux-jvm/test/test/luxc/lang/translation/jvm.lux index 7c97b1e78..233178409 100644 --- a/lux-jvm/test/test/luxc/lang/translation/jvm.lux +++ b/lux-jvm/test/test/luxc/lang/translation/jvm.lux @@ -1,10 +1,10 @@ (.module: lux (lux [io] - (control [monad #+ do] - pipe) - (data [maybe] - ["e" error] + (control pipe + [monad #+ do] + [maybe]) + (data ["e" error] [bit] [bit "bit/" Eq<Bit>] [number "int/" Number<Int> Codec<Text,Int>] @@ -35,7 +35,7 @@ [sampleI (expressionT.translate (|> (~ (<tag> <sample>)) <step1> <step2> (`)))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) (<test> <sample> (:coerce <cast> valueT)) @@ -51,9 +51,9 @@ ["jvm convert long-to-short" "jvm convert short-to-long" code.int int-sample Int i/=] ["jvm convert long-to-byte" "jvm convert byte-to-long" code.int int-sample Int i/=] )] - ($_ seq - <2step> - ))))) + ($_ seq + <2step> + ))))) (context: "Conversions [Part 2]" (<| (times +100) @@ -67,7 +67,7 @@ [sampleI (expressionT.translate (|> (~ (<tag> <sample>)) <step1> <step2> <step3> (`)))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) (<test> <sample> (:coerce <cast> valueT)) @@ -94,7 +94,7 @@ [sampleI (expressionT.translate (|> (~ (<tag> <sample>)) <step1> <step2> <step3> <step4> (`)))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) (<test> <sample> (:coerce <cast> valueT)) @@ -135,7 +135,7 @@ (<pre> (<tag> param)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) (<test> (<reference> param subject) (:coerce <type> valueT)) @@ -149,9 +149,9 @@ [(format "jvm " <domain> " /") </>] [(format "jvm " <domain> " %") <%>] )] - ($_ seq - <tests> - )))))] + ($_ seq + <tests> + )))))] ["int" gen-int code.int Int i/= (i/* 10) i/+ i/- i/* i// i/% "jvm convert long-to-int" "jvm convert int-to-long"] ["long" gen-int code.int Int i/= (i/* 10) i/+ i/- i/* i// i/% id id] @@ -174,7 +174,7 @@ (<convert> (code.nat param)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) (n/= (<reference> param subject) (:coerce Nat valueT)) @@ -208,7 +208,7 @@ ("jvm convert long-to-int" (code.nat shift)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) (<test> (<reference> shift (<pre-subject> subject)) (:coerce <type> valueT)) @@ -240,7 +240,7 @@ (<pre> (<tag> param))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) (bit/= (<reference> param subject) (:coerce Bit valueT)) @@ -251,9 +251,9 @@ [(format "jvm " <domain> " =") <=>] [(format "jvm " <domain> " <") <<>] )] - ($_ seq - <tests> - )))))] + ($_ seq + <tests> + )))))] ["int" gen-int code.int i/= i/< "jvm convert long-to-int"] ["long" gen-int code.int i/= i/< id] @@ -296,7 +296,7 @@ <post>))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputZ) (<test> <value> (:coerce <type> outputZ)) @@ -318,9 +318,9 @@ ["double" Frac valueD f/= (code.frac valueD) id] )] - ($_ seq - <array> - ))))) + ($_ seq + <array> + ))))) (context: "Array [Part 2]" (<| (times +100) @@ -344,7 +344,7 @@ <post>))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (<test> <value> (:coerce <type> outputT)) @@ -358,38 +358,38 @@ (code.int valueL) id] )] - ($_ seq - <array> - (test "java.lang.Double (level 1)" - (|> (do macro.Monad<Meta> - [#let [inner (|> ("jvm array new" +0 "java.lang.Double" (~ (code.nat size))) - ("jvm array write" "java.lang.Double" (~ (code.nat idx)) (~ (code.frac valueD))) - (`))] - sampleI (expressionT.translate (|> ("jvm array new" +1 "java.lang.Double" (~ (code.nat size))) - ("jvm array write" "#Array" (~ (code.nat idx)) (~ inner)) - ("jvm array read" "#Array" (~ (code.nat idx))) - ("jvm array read" "java.lang.Double" (~ (code.nat idx))) - (`)))] - (evalT.eval sampleI)) - (lang.with-current-module "") - (macro.run (io.run init-jvm)) - (case> (#e.Success outputT) - (f/= valueD (:coerce Frac outputT)) - - (#e.Error error) - #0))) - (test "jvm array length" - (|> (do macro.Monad<Meta> - [sampleI (expressionT.translate (` ("jvm array length" ("jvm array new" +0 "java.lang.Object" (~ (code.nat size))))))] - (evalT.eval sampleI)) - (lang.with-current-module "") - (macro.run (io.run init-jvm)) - (case> (#e.Success outputT) - (n/= size (:coerce Nat outputT)) - - (#e.Error error) - #0))) - ))))) + ($_ seq + <array> + (test "java.lang.Double (level 1)" + (|> (do macro.Monad<Meta> + [#let [inner (|> ("jvm array new" +0 "java.lang.Double" (~ (code.nat size))) + ("jvm array write" "java.lang.Double" (~ (code.nat idx)) (~ (code.frac valueD))) + (`))] + sampleI (expressionT.translate (|> ("jvm array new" +1 "java.lang.Double" (~ (code.nat size))) + ("jvm array write" "#Array" (~ (code.nat idx)) (~ inner)) + ("jvm array read" "#Array" (~ (code.nat idx))) + ("jvm array read" "java.lang.Double" (~ (code.nat idx))) + (`)))] + (evalT.eval sampleI)) + (lang.with-current-module "") + (macro.result (io.run! init-jvm)) + (case> (#e.Success outputT) + (f/= valueD (:coerce Frac outputT)) + + (#e.Error error) + #0))) + (test "jvm array length" + (|> (do macro.Monad<Meta> + [sampleI (expressionT.translate (` ("jvm array length" ("jvm array new" +0 "java.lang.Object" (~ (code.nat size))))))] + (evalT.eval sampleI)) + (lang.with-current-module "") + (macro.result (io.run! init-jvm)) + (case> (#e.Success outputT) + (n/= size (:coerce Nat outputT)) + + (#e.Error error) + #0))) + ))))) (host.import: java/lang/Class (getName [] String)) @@ -434,7 +434,7 @@ [sampleI (expressionT.translate (` ("jvm object null?" ("jvm object null"))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (:coerce Bit outputT) @@ -445,7 +445,7 @@ [sampleI (expressionT.translate (` ("jvm object null?" (~ (code.int sample)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (not (:coerce Bit outputT)) @@ -456,7 +456,7 @@ [sampleI (expressionT.translate (` ("jvm object synchronized" (~ (code.int monitor)) (~ (code.int sample)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (i/= sample (:coerce Int outputT)) @@ -471,7 +471,7 @@ (~ exception-message$)))))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (case (:coerce (e.Error Any) outputT) (#e.Error error) @@ -487,7 +487,7 @@ [sampleI (expressionT.translate (` ("jvm object class" (~ (code.text class)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (|> outputT (:coerce Class) (Class::getName []) (text/= class)) @@ -498,7 +498,7 @@ [sampleI (expressionT.translate (` ("jvm object instance?" (~ (code.text instance-class)) (~ instance))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (:coerce Bit outputT) @@ -530,7 +530,7 @@ [sampleI (expressionT.translate (` ("jvm convert int-to-long" ("jvm member static get" "java.util.GregorianCalendar" "AD" "int"))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (i/= GregorianCalendar::AD (:coerce Int outputT)) @@ -542,7 +542,7 @@ ("jvm member static get" "java.awt.datatransfer.DataFlavor" "allHtmlFlavor" "java.awt.datatransfer.DataFlavor"))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (is? hostL.unit (:coerce Text outputT)) @@ -553,7 +553,7 @@ [sampleI (expressionT.translate (` ("jvm member virtual get" "org.omg.CORBA.ValueMember" "name" "java.lang.String" (~ value-memberS))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (text/= sample-string (:coerce Text outputT)) @@ -566,7 +566,7 @@ (~ (code.text other-sample-string)) (~ value-memberS)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (text/= other-sample-string (:coerce Text outputT)) @@ -595,7 +595,7 @@ (~ coded-intS))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (i/= sample (:coerce Int outputT)) @@ -608,7 +608,7 @@ (~ (code.int sample)) (~ object-longS)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (:coerce Bit outputT) @@ -621,7 +621,7 @@ (~ array-listS) (~ object-longS)))))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (:coerce Bit outputT) @@ -632,7 +632,7 @@ [sampleI (expressionT.translate array-listS)] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success outputT) (host.instance? ArrayList (:coerce Object outputT)) |