diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/ffi.jvm.lux | 91 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.old.lux | 79 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi/export.jvm.lux | 58 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/frac.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/target/jvm.lux | 50 |
5 files changed, 154 insertions, 130 deletions
diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index a7d5c88bb..74107be7d 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -39,16 +39,21 @@ ["$[0]" / "_" ["[1][0]" export]]) -(/.import: java/lang/Boolean) -(/.import: java/lang/Long) +(/.import: java/lang/Boolean + "[1]::[0]") -(/.import: java/lang/String) +(/.import: java/lang/Long + "[1]::[0]") -(/.import: java/lang/Object) +(/.import: java/lang/String + "[1]::[0]") + +(/.import: java/lang/Object + "[1]::[0]") (/.import: (java/lang/Class a) - ["[1]::[0]" - (getName [] java/lang/String)]) + "[1]::[0]" + (getName [] java/lang/String)) (template [<name> <type> <conversion> <lux> <=>] [(def: (<name> left right) @@ -257,36 +262,36 @@ ([] actual0 [] java/lang/Long)) (/.import: test/TestInterface0 - ["[1]::[0]" - (actual0 [] java/lang/Long)]) + "[1]::[0]" + (actual0 [] java/lang/Long)) (/.interface: test/TestInterface1 ([] actual1 [java/lang/Boolean] java/lang/Long "throws" [java/lang/Throwable])) (/.import: test/TestInterface1 - ["[1]::[0]" - (actual1 [java/lang/Boolean] "try" java/lang/Long)]) + "[1]::[0]" + (actual1 [java/lang/Boolean] "try" java/lang/Long)) (/.interface: test/TestInterface2 ([a] actual2 [a] a)) (/.import: test/TestInterface2 - ["[1]::[0]" - ([a] actual2 [a] a)]) + "[1]::[0]" + ([a] actual2 [a] a)) (/.interface: (test/TestInterface3 a) ([] actual3 [] a)) (/.import: (test/TestInterface3 a) - ["[1]::[0]" - (actual3 [] a)]) + "[1]::[0]" + (actual3 [] a)) (/.interface: test/TestInterface4 ([] actual4 [long long] long)) (/.import: test/TestInterface4 - ["[1]::[0]" - (actual4 [long long] long)]) + "[1]::[0]" + (actual4 [long long] long)) (def: for_interface Test @@ -379,8 +384,8 @@ ::value)) (/.import: test/TestClass0 - ["[1]::[0]" - (new [java/lang/Long])]) + "[1]::[0]" + (new [java/lang/Long])) (/.class: "final" test/TestClass1 [test/TestInterface1] ... Fields @@ -397,8 +402,8 @@ ::value))) (/.import: test/TestClass1 - ["[1]::[0]" - (new [java/lang/Long])]) + "[1]::[0]" + (new [java/lang/Long])) (/.class: "final" test/TestClass2 [test/TestInterface2] ... Constructors @@ -411,8 +416,8 @@ input)) (/.import: test/TestClass2 - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (/.class: "final" (test/TestClass3 a) [(test/TestInterface3 a)] ... Fields @@ -427,8 +432,8 @@ ::value)) (/.import: (test/TestClass3 a) - ["[1]::[0]" - (new [a])]) + "[1]::[0]" + (new [a])) (/.class: "final" test/TestClass4 [] ... Constructors @@ -439,9 +444,9 @@ value)) (/.import: test/TestClass4 - ["[1]::[0]" - (new []) - (actual4 [java/lang/Long] java/lang/Long)]) + "[1]::[0]" + (new []) + (actual4 [java/lang/Long] java/lang/Long)) (/.class: "final" test/TestClass5 [] ... Constructors @@ -453,8 +458,8 @@ value)) (/.import: test/TestClass5 - ["[1]::[0]" - ("static" actual5 [java/lang/Long] java/lang/Long)]) + "[1]::[0]" + ("static" actual5 [java/lang/Long] java/lang/Long)) (/.class: "abstract" test/TestClass6 [] ... Constructors @@ -465,8 +470,8 @@ java/lang/Long)) (/.import: test/TestClass6 - ["[1]::[0]" - (actual6 [java/lang/Long] java/lang/Long)]) + "[1]::[0]" + (actual6 [java/lang/Long] java/lang/Long)) (/.class: "final" test/TestClass7 test/TestClass6 [] ... Constructors @@ -479,8 +484,8 @@ input)) (/.import: test/TestClass7 - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (/.class: "final" test/TestClass8 [test/TestInterface4] ... Constructors @@ -496,8 +501,8 @@ (/.of_long actual_right))))) (/.import: test/TestClass8 - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (/.class: "final" (test/TestClass9 a) [] ... Fields @@ -512,10 +517,10 @@ ::value9)) (/.import: (test/TestClass9 a) - ["[1]::[0]" - (new [a]) - (set_actual9 [a] void) - (get_actual9 [] a)]) + "[1]::[0]" + (new [a]) + (set_actual9 [a] void) + (get_actual9 [] a)) (def: for_class Test @@ -632,11 +637,11 @@ (not (expands? (/.import: <class>))))) (_.cover [/.class_name_cannot_be_a_type_variable] (and (not (expands? (/.import: (java/lang/Double a) - ["[1]::[0]" - (invalid [] (a java/lang/String))]))) + "[1]::[0]" + (invalid [] (a java/lang/String))))) (not (expands? (/.import: java/lang/Double - ["[1]::[0]" - ([a] invalid [] (a java/lang/String))]))))) + "[1]::[0]" + ([a] invalid [] (a java/lang/String))))))) (_.cover [/.unknown_type_variable] (let [type_variable ((debug.private /.type_variable) (list (jvm.var var/0) (jvm.var var/1)))] (and (|> (list (code.local_symbol var/0)) diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux index fc503636a..1a9db190f 100644 --- a/stdlib/source/test/lux/ffi.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux @@ -1,37 +1,40 @@ (.using - [library - [lux "*" - ["_" test {"+" Test}] - [abstract - [equivalence {"+" Equivalence}] - [monad {"+" do}]] - [control - [pipe {"+" case>}]] - [data - ["[0]" text ("[1]#[0]" equivalence) - ["%" format {"+" format}]]] - [macro - ["[0]" template]] - [math - ["[0]" random] - [number - ["n" nat] - ["i" int] - ["f" frac]]] - ["[0]" type ("[1]#[0]" equivalence)]]] - [\\library - ["[0]" /]]) - -(/.import: java/lang/Object) -(/.import: java/lang/String) + [library + [lux "*" + ["_" test {"+" Test}] + [abstract + [equivalence {"+" Equivalence}] + [monad {"+" do}]] + [control + [pipe {"+" case>}]] + [data + ["[0]" text ("[1]#[0]" equivalence) + ["%" format {"+" format}]]] + [macro + ["[0]" template]] + [math + ["[0]" random] + [number + ["n" nat] + ["i" int] + ["f" frac]]] + ["[0]" type ("[1]#[0]" equivalence)]]] + [\\library + ["[0]" /]]) + +(/.import: java/lang/Object + "[1]::[0]") + +(/.import: java/lang/String + "[1]::[0]") (/.import: java/lang/Exception - ["[1]::[0]" - (new [java/lang/String])]) + "[1]::[0]" + (new [java/lang/String])) (/.import: (java/lang/Class a) - ["[1]::[0]" - (getName [] java/lang/String)]) + "[1]::[0]" + (getName [] java/lang/String)) (/.class: "final" (TestClass A) [] ... Fields @@ -51,11 +54,11 @@ (:= ::counter (i.- ::increase ::counter)))) (/.import: (test/lux/ffi/TestClass a) - ["[1]::[0]" - (new [java/lang/Long java/lang/Long]) - (currentC [] java/lang/Long) - (upC [] void) - (downC [] void)]) + "[1]::[0]" + (new [java/lang/Long java/lang/Long]) + (currentC [] java/lang/Long) + (upC [] void) + (downC [] void)) (/.interface: TestInterface ([] current [] java/lang/Long "throws" [java/lang/Exception]) @@ -63,10 +66,10 @@ ([] down [] test/lux/ffi/TestInterface "throws" [java/lang/Exception])) (/.import: test/lux/ffi/TestInterface - ["[1]::[0]" - (current [] java/lang/Long) - (up [] java/lang/Long) - (down [] java/lang/Long)]) + "[1]::[0]" + (current [] java/lang/Long) + (up [] java/lang/Long) + (down [] java/lang/Long)) (def: (test_object increase counter) (-> Int Int test/lux/ffi/TestInterface) diff --git a/stdlib/source/test/lux/ffi/export.jvm.lux b/stdlib/source/test/lux/ffi/export.jvm.lux index 24ef68929..cde493f1f 100644 --- a/stdlib/source/test/lux/ffi/export.jvm.lux +++ b/stdlib/source/test/lux/ffi/export.jvm.lux @@ -67,29 +67,29 @@ ))) (`` (`` (//.import: Primitives - ["[1]::[0]" - ("static" actual_boolean boolean) - ("static" actual_byte byte) - ("static" actual_short short) - ("static" actual_int int) - ("static" actual_long long) - ("static" actual_char char) - ("static" actual_float float) - ("static" actual_double double) - - (~~ (template [<type>] - [("static" (~~ (template.symbol [<type> "_method"])) [<type> <type>] <type>)] - - [boolean] - [byte] - [short] - [int] - [long] - [char] - [float] - [double] - )) - ]))) + "[1]::[0]" + ("static" actual_boolean boolean) + ("static" actual_byte byte) + ("static" actual_short short) + ("static" actual_int int) + ("static" actual_long long) + ("static" actual_char char) + ("static" actual_float float) + ("static" actual_double double) + + (~~ (template [<type>] + [("static" (~~ (template.symbol [<type> "_method"])) [<type> <type>] <type>)] + + [boolean] + [byte] + [short] + [int] + [long] + [char] + [float] + [double] + )) + ))) (/.export: Objects (actual_string java/lang/String ..expected_string) @@ -102,13 +102,13 @@ (([a] right [left a right a]) a right)) (//.import: Objects - ["[1]::[0]" - ("static" actual_string java/lang/String) + "[1]::[0]" + ("static" actual_string java/lang/String) - ("static" string_method [java/lang/String java/lang/String] java/lang/String) - - ("static" [a] left [a a] a) - ("static" [a] right [a a] a)]) + ("static" string_method [java/lang/String java/lang/String] java/lang/String) + + ("static" [a] left [a a] a) + ("static" [a] right [a a] a)) (def: tiny_int (Random Int) diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index c8b786701..f78b23afd 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -119,9 +119,9 @@ ))) (with_expansions [<jvm> (as_is (ffi.import: java/lang/Double - ["[1]::[0]" - ("static" doubleToRawLongBits [double] long) - ("static" longBitsToDouble [long] double)]))] + "[1]::[0]" + ("static" doubleToRawLongBits [double] long) + ("static" longBitsToDouble [long] double)))] (for @.old (as_is <jvm>) @.jvm (as_is <jvm>) (as_is))) diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index 562473fb0..5a919761c 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -59,30 +59,46 @@ /method.public /method.static)) -(import: java/lang/Boolean) -(import: java/lang/Byte) -(import: java/lang/Short) -(import: java/lang/Integer) -(import: java/lang/Long) -(import: java/lang/Float) +(import: java/lang/Boolean + "[1]::[0]") + +(import: java/lang/Byte + "[1]::[0]") + +(import: java/lang/Short + "[1]::[0]") + +(import: java/lang/Integer + "[1]::[0]") + +(import: java/lang/Long + "[1]::[0]") + +(import: java/lang/Float + "[1]::[0]") + (import: java/lang/Double - ["[1]::[0]" - ("static" compare [double double] int)]) -(import: java/lang/Character) -(import: java/lang/String) + "[1]::[0]" + ("static" compare [double double] int)) + +(import: java/lang/Character + "[1]::[0]") + +(import: java/lang/String + "[1]::[0]") (import: java/lang/reflect/Method - ["[1]::[0]" - (invoke [java/lang/Object [java/lang/Object]] "try" java/lang/Object)]) + "[1]::[0]" + (invoke [java/lang/Object [java/lang/Object]] "try" java/lang/Object)) (import: (java/lang/Class c) - ["[1]::[0]" - (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)]) + "[1]::[0]" + (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)) (import: java/lang/Object - ["[1]::[0]" - (getClass [] (java/lang/Class java/lang/Object)) - (toString [] java/lang/String)]) + "[1]::[0]" + (getClass [] (java/lang/Class java/lang/Object)) + (toString [] java/lang/String)) (def: class_name (Random Text) |