From a62ce3f9c2b605e0033f4772b0f64c4525de4d86 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 11 Aug 2021 02:38:59 -0400 Subject: Relocated maybe and lazy from data to control. --- lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux | 8 +- .../test/test/luxc/lang/synthesis/procedure.lux | 2 +- lux-jvm/test/test/luxc/lang/translation/jvm.lux | 142 ++++++++++----------- 3 files changed, 76 insertions(+), 76 deletions(-) (limited to 'lux-jvm/test') 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) 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 _) @@ -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 _) 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] [number "int/" Number Codec] @@ -35,7 +35,7 @@ [sampleI (expressionT.translate (|> (~ ( )) (`)))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) ( (:coerce 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 (|> (~ ( )) (`)))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) ( (:coerce valueT)) @@ -94,7 +94,7 @@ [sampleI (expressionT.translate (|> (~ ( )) (`)))] (evalT.eval sampleI)) (lang.with-current-module "") - (macro.run (io.run init-jvm)) + (macro.result (io.run! init-jvm)) (case> (#e.Success valueT) ( (:coerce valueT)) @@ -135,7 +135,7 @@ (
 ( param)))))]
                                                     (evalT.eval sampleI))
                                                   (lang.with-current-module "")
-                                                  (macro.run (io.run init-jvm))
+                                                  (macro.result (io.run! init-jvm))
                                                   (case> (#e.Success valueT)
                                                          ( ( param subject)
                                                                  (:coerce  valueT))
@@ -149,9 +149,9 @@
                                        [(format "jvm "  " /") ]
                                        [(format "jvm "  " %") <%>]
                                        )]
-             ($_ seq
-                 
-                 )))))]
+                            ($_ seq
+                                
+                                )))))]
 
   ["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 @@
                                                                                ( (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/= ( 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)
                                            ( ( shift ( subject))
                                                    (:coerce  valueT))
@@ -240,7 +240,7 @@
                                                                                      (
 ( 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/= ( param subject)
                                                                 (:coerce Bit valueT))
@@ -251,9 +251,9 @@
                                        [(format "jvm "  " =") <=>]
                                        [(format "jvm "  " <") <<>]
                                        )]
-             ($_ seq
-                 
-                 )))))]
+                            ($_ seq
+                                
+                                )))))]
 
   ["int" gen-int code.int i/= i/< "jvm convert long-to-int"]
   ["long" gen-int code.int i/= i/< id]
@@ -296,7 +296,7 @@
                                                                                      ))]
                                                  (evalT.eval sampleI))
                                                (lang.with-current-module "")
-                                               (macro.run (io.run init-jvm))
+                                               (macro.result (io.run! init-jvm))
                                                (case> (#e.Success outputZ)
                                                       (  (:coerce  outputZ))
 
@@ -318,9 +318,9 @@
                                     ["double" Frac valueD f/= (code.frac valueD)
                                      id]
                                     )]
-          ($_ seq
-              
-              )))))
+                         ($_ seq
+                             
+                             )))))
 
 (context: "Array [Part 2]"
   (<| (times +100)
@@ -344,7 +344,7 @@
                                                                                      ))]
                                                  (evalT.eval sampleI))
                                                (lang.with-current-module "")
-                                               (macro.run (io.run init-jvm))
+                                               (macro.result (io.run! init-jvm))
                                                (case> (#e.Success outputT)
                                                       (  (:coerce  outputT))
 
@@ -358,38 +358,38 @@
                                      (code.int valueL)
                                      id]
                                     )]
-          ($_ seq
-              
-              (test "java.lang.Double (level 1)"
-                    (|> (do macro.Monad
-                          [#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
-                          [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
+                             
+                             (test "java.lang.Double (level 1)"
+                                   (|> (do macro.Monad
+                                         [#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
+                                         [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))
 
-- 
cgit v1.2.3