diff options
Diffstat (limited to 'new-luxc/test/test/luxc/lang/analysis')
8 files changed, 36 insertions, 35 deletions
diff --git a/new-luxc/test/test/luxc/lang/analysis/common.lux b/new-luxc/test/test/luxc/lang/analysis/common.lux index 38c712972..cf213ccef 100644 --- a/new-luxc/test/test/luxc/lang/analysis/common.lux +++ b/new-luxc/test/test/luxc/lang/analysis/common.lux @@ -1,6 +1,7 @@ (.module: lux - (lux (control pipe) + (lux [io] + (control pipe) ["r" math/random "r/" Monad<Random>] (data ["e" error]) [macro] @@ -40,7 +41,7 @@ [(def: #export (<name> analysis) (All [a] (-> (Meta a) Bool)) (|> analysis - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) <on-success> diff --git a/new-luxc/test/test/luxc/lang/analysis/function.lux b/new-luxc/test/test/luxc/lang/analysis/function.lux index 62d5ad93c..968de53ef 100644 --- a/new-luxc/test/test/luxc/lang/analysis/function.lux +++ b/new-luxc/test/test/luxc/lang/analysis/function.lux @@ -55,7 +55,7 @@ (-> Type Nat (Meta la.Analysis) Bool) (|> analysis (&.with-type expectedT) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success applyA) (let [[funcA argsA] (flatten-apply applyA)] (n/= num-args (list.size argsA))) @@ -75,25 +75,25 @@ (test "Can analyse function." (and (|> (&.with-type (All [a] (-> a outputT)) (@.analyse-function analyse func-name arg-name outputC)) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) succeeds?) (|> (&.with-type (All [a] (-> a a)) (@.analyse-function analyse func-name arg-name g!arg)) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) succeeds?))) (test "Generic functions can always be specialized." (and (|> (&.with-type (-> inputT outputT) (@.analyse-function analyse func-name arg-name outputC)) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) succeeds?) (|> (&.with-type (-> inputT inputT) (@.analyse-function analyse func-name arg-name g!arg)) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) succeeds?))) (test "The function's name is bound to the function's type." (|> (&.with-type (Rec self (-> inputT self)) (@.analyse-function analyse func-name arg-name (code.local-symbol func-name))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) succeeds?)) )))) diff --git a/new-luxc/test/test/luxc/lang/analysis/primitive.lux b/new-luxc/test/test/luxc/lang/analysis/primitive.lux index d8ba4561f..96e2c62f9 100644 --- a/new-luxc/test/test/luxc/lang/analysis/primitive.lux +++ b/new-luxc/test/test/luxc/lang/analysis/primitive.lux @@ -32,7 +32,7 @@ (test "Can analyse unit." (|> (@common.with-unknown-type @.analyse-unit) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^ (#e.Success [_type (^code [])])) (type/= Unit _type) @@ -43,7 +43,7 @@ [(test (format "Can analyse " <desc> ".") (|> (@common.with-unknown-type (<analyser> <value>)) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success [_type [_ (<tag> value)]]) (and (type/= <type> _type) (is <value> value)) 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 9701a04b6..f51938046 100644 --- a/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux +++ b/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux @@ -29,7 +29,7 @@ (|> (&.with-scope (&.with-type output-type (analyse (` ((~ (code.text procedure)) (~+ params)))))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) <success> @@ -261,7 +261,7 @@ (&scope.with-local [var-name arrayT] (&.with-type output-type (analyse code)))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) true @@ -335,7 +335,7 @@ (&scope.with-local [var-name atomT] (&.with-type elemT (analyse (` ("lux atom read" (~ (code.symbol ["" var-name])))))))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) true @@ -349,7 +349,7 @@ (~ (code.symbol ["" var-name])) (~ elemC) (~ elemC))))))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) true diff --git a/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux b/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux index 7b2b993d2..efc550ff5 100644 --- a/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux +++ b/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux @@ -39,7 +39,7 @@ ((expressionA.analyser evalL.eval) (` ((~ (code.text procedure)) (~+ params))))))) (&.with-current-module "") - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) <success> @@ -59,7 +59,7 @@ (&.with-type output-type (expressionA.analyser evalL.eval syntax)))) (&.with-current-module "") - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) <success> diff --git a/new-luxc/test/test/luxc/lang/analysis/reference.lux b/new-luxc/test/test/luxc/lang/analysis/reference.lux index 45e1eb0e8..0ab23600b 100644 --- a/new-luxc/test/test/luxc/lang/analysis/reference.lux +++ b/new-luxc/test/test/luxc/lang/analysis/reference.lux @@ -30,7 +30,7 @@ (&scope.with-local [var-name ref-type] (@common.with-unknown-type (@.analyse-reference ["" var-name])))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^ (#e.Success [_type (^code ((~ [_ (#.Int var)])))])) (type/= ref-type _type) @@ -43,7 +43,7 @@ [ref-type (' {}) (:! Void [])])] (@common.with-unknown-type (@.analyse-reference [module-name var-name]))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success [_type [_ (#.Symbol def-name)]]) (type/= ref-type _type) diff --git a/new-luxc/test/test/luxc/lang/analysis/structure.lux b/new-luxc/test/test/luxc/lang/analysis/structure.lux index 42177ebb4..cdef25448 100644 --- a/new-luxc/test/test/luxc/lang/analysis/structure.lux +++ b/new-luxc/test/test/luxc/lang/analysis/structure.lux @@ -47,7 +47,7 @@ (|> (&.with-scope (&.with-type variantT (@.analyse-sum analyse choice valueC))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^multi (#e.Success [_ sumA]) [(la.unfold-variant sumA) (#.Some [tag last? valueA])]) @@ -64,7 +64,7 @@ (tc.check varT variantT))] (&.with-type varT (@.analyse-sum analyse choice valueC)))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^multi (#e.Success [_ sumA]) [(la.unfold-variant sumA) (#.Some [tag last? valueA])]) @@ -79,7 +79,7 @@ [[_ varT] (&.with-type-env tc.var)] (&.with-type varT (@.analyse-sum analyse choice valueC)))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) false @@ -89,7 +89,7 @@ (|> (&.with-scope (&.with-type (type.ex-q +1 +variantT) (@.analyse-sum analyse +choice +valueC))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) true @@ -99,7 +99,7 @@ (|> (&.with-scope (&.with-type (type.univ-q +1 +variantT) (@.analyse-sum analyse +choice +valueC))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) (not (n/= choice +choice)) @@ -123,7 +123,7 @@ (test "Can analyse product." (|> (&.with-type (type.tuple (list/map product.left primitives)) (@.analyse-product analyse (list/map product.right primitives))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success tupleA) (n/= size (list.size (la.unfold-tuple tupleA))) @@ -132,7 +132,7 @@ (test "Can infer product." (|> (@common.with-unknown-type (@.analyse-product analyse (list/map product.right primitives))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success [_type tupleA]) (and (type/= (type.tuple (list/map product.left primitives)) _type) @@ -143,7 +143,7 @@ (test "Can analyse pseudo-product (singleton tuple)" (|> (&.with-type singletonT (analyse (` [(~ singletonC)]))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success singletonA) true @@ -157,7 +157,7 @@ (tc.check varT (type.tuple (list/map product.left primitives))))] (&.with-type varT (@.analyse-product analyse (list/map product.right primitives))))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success [_ tupleA]) (n/= size (list.size (la.unfold-tuple tupleA))) @@ -167,7 +167,7 @@ (|> (&.with-scope (&.with-type (type.ex-q +1 +tupleT) (@.analyse-product analyse (list/map product.right +primitives)))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) true @@ -177,7 +177,7 @@ (|> (&.with-scope (&.with-type (type.univ-q +1 +tupleT) (@.analyse-product analyse (list/map product.right +primitives)))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success _) false @@ -189,7 +189,7 @@ (-> Type Nat Nat (Meta [Module Scope la.Analysis]) Bool) (|> analysis (&.with-type variantT) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^multi (#e.Success [_ _ sumA]) [(la.unfold-variant sumA) (#.Some [tag last? valueA])]) @@ -202,7 +202,7 @@ (def: (check-record-inference tupleT size analysis) (-> Type Nat (Meta [Module Scope Type la.Analysis]) Bool) (|> analysis - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^multi (#e.Success [_ _ productT productA]) [(la.unfold-tuple productA) membersA]) @@ -264,7 +264,7 @@ (&.with-scope (&.with-type variantT (@.analyse-tagged-sum analyse [module-name other-choice-tag] other-choiceC))))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^multi (#e.Success [_ _ sumA]) [(la.unfold-variant sumA) (#.Some [tag last? valueA])]) @@ -320,7 +320,7 @@ (&.with-scope (&.with-type tupleT (@.analyse-record analyse recordC))))) - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (^multi (#e.Success [_ _ productA]) [(la.unfold-tuple productA) membersA]) diff --git a/new-luxc/test/test/luxc/lang/analysis/type.lux b/new-luxc/test/test/luxc/lang/analysis/type.lux index 4de75b989..3826b1e5d 100644 --- a/new-luxc/test/test/luxc/lang/analysis/type.lux +++ b/new-luxc/test/test/luxc/lang/analysis/type.lux @@ -58,7 +58,7 @@ (@common.with-unknown-type (@.analyse-check analyse eval.eval typeC exprC)))) (&.with-current-module "") - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success [_ [analysisT analysisA]]) (and (type/= codeT analysisT) (case [exprC analysisA] @@ -84,7 +84,7 @@ (@common.with-unknown-type (@.analyse-coerce analyse eval.eval typeC exprC)))) (&.with-current-module "") - (macro.run (init-compiler [])) + (macro.run (io.run init-jvm)) (case> (#e.Success [_ [analysisT analysisA]]) (type/= codeT analysisT) |