diff options
author | Eduardo Julian | 2021-05-24 19:29:13 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-05-24 19:29:13 -0400 |
commit | da27db478b368724ee4659eb674dcdbeb2cd8747 (patch) | |
tree | c1c5ef50644fa78ea899ac8c0afa1e234cd03b26 /stdlib/source/test | |
parent | 1ffd2dd7e37d3be90522dfe768226334f60577f5 (diff) |
Re-named lux/host to lux/ffi.
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/control/function/contract.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.js.lux (renamed from stdlib/source/test/lux/host.js.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.jvm.lux (renamed from stdlib/source/test/lux/host.jvm.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.lua.lux (renamed from stdlib/source/test/lux/host.lua.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.old.lux (renamed from stdlib/source/test/lux/host.old.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.php.lux (renamed from stdlib/source/test/lux/host.php.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.py.lux (renamed from stdlib/source/test/lux/host.py.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.rb.lux (renamed from stdlib/source/test/lux/host.rb.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/ffi.scm.lux (renamed from stdlib/source/test/lux/host.scm.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/frac.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/target/jvm.lux | 142 | ||||
-rw-r--r-- | stdlib/source/test/lux/time/instant.lux | 4 |
13 files changed, 82 insertions, 82 deletions
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 8532b3e12..40a797177 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -39,7 +39,7 @@ ## ["#." tool] ## TODO: Update & expand tests for this ["#." type] ["#." world] - ["#." host] + ["#." ffi] ["#." extension] ["#." target #_ <target>]])) @@ -220,7 +220,7 @@ ## /tool.test /type.test /world.test - /host.test + /ffi.test (for {@.jvm (#.Cons /target/jvm.test tail) @.old (#.Cons /target/jvm.test tail)} tail) diff --git a/stdlib/source/test/lux/control/function/contract.lux b/stdlib/source/test/lux/control/function/contract.lux index 47962d04a..76eb07104 100644 --- a/stdlib/source/test/lux/control/function/contract.lux +++ b/stdlib/source/test/lux/control/function/contract.lux @@ -1,7 +1,7 @@ (.module: [lux #* ["_" test (#+ Test)] - ["." host] + ["." ffi] [abstract [monad (#+ do)]] [control @@ -20,16 +20,16 @@ [expected random.nat]) ($_ _.and (_.cover [/.pre] - (case (host.try (/.pre (n.even? expected) - true)) + (case (ffi.try (/.pre (n.even? expected) + true)) (#try.Success output) output (#try.Failure error) (not (n.even? expected)))) (_.cover [/.post] - (case (host.try (/.post n.odd? - expected)) + (case (ffi.try (/.post n.odd? + expected)) (#try.Success actual) (is? expected actual) diff --git a/stdlib/source/test/lux/host.js.lux b/stdlib/source/test/lux/ffi.js.lux index 5ffe1fbeb..5ffe1fbeb 100644 --- a/stdlib/source/test/lux/host.js.lux +++ b/stdlib/source/test/lux/ffi.js.lux diff --git a/stdlib/source/test/lux/host.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 9edaecd0c..9edaecd0c 100644 --- a/stdlib/source/test/lux/host.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux diff --git a/stdlib/source/test/lux/host.lua.lux b/stdlib/source/test/lux/ffi.lua.lux index 0b6cac81b..0b6cac81b 100644 --- a/stdlib/source/test/lux/host.lua.lux +++ b/stdlib/source/test/lux/ffi.lua.lux diff --git a/stdlib/source/test/lux/host.old.lux b/stdlib/source/test/lux/ffi.old.lux index b14dac30d..b14dac30d 100644 --- a/stdlib/source/test/lux/host.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux diff --git a/stdlib/source/test/lux/host.php.lux b/stdlib/source/test/lux/ffi.php.lux index 0b6cac81b..0b6cac81b 100644 --- a/stdlib/source/test/lux/host.php.lux +++ b/stdlib/source/test/lux/ffi.php.lux diff --git a/stdlib/source/test/lux/host.py.lux b/stdlib/source/test/lux/ffi.py.lux index 0b6cac81b..0b6cac81b 100644 --- a/stdlib/source/test/lux/host.py.lux +++ b/stdlib/source/test/lux/ffi.py.lux diff --git a/stdlib/source/test/lux/host.rb.lux b/stdlib/source/test/lux/ffi.rb.lux index 0b6cac81b..0b6cac81b 100644 --- a/stdlib/source/test/lux/host.rb.lux +++ b/stdlib/source/test/lux/ffi.rb.lux diff --git a/stdlib/source/test/lux/host.scm.lux b/stdlib/source/test/lux/ffi.scm.lux index 0b6cac81b..0b6cac81b 100644 --- a/stdlib/source/test/lux/host.scm.lux +++ b/stdlib/source/test/lux/ffi.scm.lux diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index 5f37be2ef..ddeab3763 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -2,7 +2,7 @@ [lux #* ["_" test (#+ Test)] ["@" target] - ["." host] + ["." ffi] [abstract [monad (#+ do)] {[0 #spec] @@ -118,7 +118,7 @@ )) ))) -(with_expansions [<jvm> (as_is (host.import: java/lang/Double +(with_expansions [<jvm> (as_is (ffi.import: java/lang/Double ["#::." (#static doubleToRawLongBits [double] long) (#static longBitsToDouble [long] double)]))] diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index f2c8963d3..6e22d611f 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -1,6 +1,6 @@ (.module: [lux (#- Type type primitive int) - ["." host (#+ import:)] + ["." ffi (#+ import:)] ["@" target] [abstract ["." monad (#+ do)]] @@ -96,7 +96,7 @@ (def: (get_method name class) (-> Text (java/lang/Class java/lang/Object) java/lang/reflect/Method) (java/lang/Class::getDeclaredMethod name - (host.array (java/lang/Class java/lang/Object) 0) + (ffi.array (java/lang/Class java/lang/Object) 0) class)) (def: $Object (/type.class "java.lang.Object" (list))) @@ -124,8 +124,8 @@ loader (/loader.memory (/loader.new_library []))] _ (/loader.define class_name bytecode loader) class (io.run (/loader.load class_name loader)) - method (host.try (get_method method_name class))] - (java/lang/reflect/Method::invoke (host.null) (host.array java/lang/Object 0) method)) + method (ffi.try (get_method method_name class))] + (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)) (#try.Success actual) (test actual) @@ -165,10 +165,10 @@ (/.invokestatic ..$Byte "valueOf" (/type.method [(list /type.byte) ..$Byte (list)]))) (def: $Byte::random (Random java/lang/Byte) - (\ random.monad map (|>> (:coerce java/lang/Long) host.long_to_byte) random.int)) + (\ random.monad map (|>> (:coerce java/lang/Long) ffi.long_to_byte) random.int)) (def: $Byte::literal (-> java/lang/Byte (Bytecode Any)) - (|>> host.byte_to_long (:coerce I64) i32.i32 /.int)) + (|>> ffi.byte_to_long (:coerce I64) i32.i32 /.int)) (def: $Byte::primitive (Primitive java/lang/Byte) {#unboxed /type.byte @@ -183,10 +183,10 @@ (/.invokestatic ..$Short "valueOf" (/type.method [(list /type.short) ..$Short (list)]))) (def: $Short::random (Random java/lang/Short) - (\ random.monad map (|>> (:coerce java/lang/Long) host.long_to_short) random.int)) + (\ random.monad map (|>> (:coerce java/lang/Long) ffi.long_to_short) random.int)) (def: $Short::literal (-> java/lang/Short (Bytecode Any)) - (|>> host.short_to_long (:coerce I64) i32.i32 /.int)) + (|>> ffi.short_to_long (:coerce I64) i32.i32 /.int)) (def: $Short::primitive (Primitive java/lang/Short) {#unboxed /type.short @@ -201,10 +201,10 @@ (/.invokestatic ..$Integer "valueOf" (/type.method [(list /type.int) ..$Integer (list)]))) (def: $Integer::random (Random java/lang/Integer) - (\ random.monad map (|>> (:coerce java/lang/Long) host.long_to_int) random.int)) + (\ random.monad map (|>> (:coerce java/lang/Long) ffi.long_to_int) random.int)) (def: $Integer::literal (-> java/lang/Integer (Bytecode Any)) - (|>> host.int_to_long (:coerce I64) i32.i32 /.int)) + (|>> ffi.int_to_long (:coerce I64) i32.i32 /.int)) (def: $Integer::primitive (Primitive java/lang/Integer) {#unboxed /type.int @@ -230,12 +230,12 @@ (def: $Float::random (Random java/lang/Float) (\ random.monad map - (|>> (:coerce java/lang/Double) host.double_to_float) + (|>> (:coerce java/lang/Double) ffi.double_to_float) random.frac)) (def: $Float::literal /.float) (def: valid_float (Random java/lang/Float) - (random.filter (|>> host.float_to_double (:coerce Frac) f.not_a_number? not) + (random.filter (|>> ffi.float_to_double (:coerce Frac) f.not_a_number? not) ..$Float::random)) (def: $Float::primitive (Primitive java/lang/Float) @@ -269,10 +269,10 @@ (/.invokestatic ..$Character "valueOf" (/type.method [(list /type.char) ..$Character (list)]))) (def: $Character::random (Random java/lang/Character) - (\ random.monad map (|>> (:coerce java/lang/Long) host.long_to_int host.int_to_char) random.int)) + (\ random.monad map (|>> (:coerce java/lang/Long) ffi.long_to_int ffi.int_to_char) random.int)) (def: $Character::literal (-> java/lang/Character (Bytecode Any)) - (|>> host.char_to_long (:coerce I64) i32.i32 /.int)) + (|>> ffi.char_to_long (:coerce I64) i32.i32 /.int)) (def: $Character::primitive (Primitive java/lang/Character) {#unboxed /type.char @@ -314,8 +314,8 @@ [_ (<push> (|> expected .int <signed> try.assume))] <wrap>))))] - [byte 7 java/lang/Byte /.bipush ..$Byte::wrap "BIPUSH" host.byte_to_long /signed.s1] - [short 15 java/lang/Short /.sipush ..$Short::wrap "SIPUSH" host.short_to_long /signed.s2] + [byte 7 java/lang/Byte /.bipush ..$Byte::wrap "BIPUSH" ffi.byte_to_long /signed.s1] + [short 15 java/lang/Short /.sipush ..$Short::wrap "SIPUSH" ffi.short_to_long /signed.s2] ) (template [<name> <type>] @@ -382,7 +382,7 @@ shift (: (-> (-> java/lang/Integer java/lang/Integer java/lang/Integer) (Bytecode Any) (Random Bit)) (function (_ reference instruction) (do {! random.monad} - [parameter (\ ! map (|>> (n.% 32) .int (:coerce java/lang/Long) host.long_to_int) random.nat) + [parameter (\ ! map (|>> (n.% 32) .int (:coerce java/lang/Long) ffi.long_to_int) random.nat) subject ..$Integer::random] (int (reference parameter subject) (do /.monad @@ -390,13 +390,13 @@ _ (..$Integer::literal parameter)] instruction))))) literal ($_ _.and - (_.lift "ICONST_M1" (int (host.long_to_int (:coerce java/lang/Long -1)) /.iconst_m1)) - (_.lift "ICONST_0" (int (host.long_to_int (:coerce java/lang/Long +0)) /.iconst_0)) - (_.lift "ICONST_1" (int (host.long_to_int (:coerce java/lang/Long +1)) /.iconst_1)) - (_.lift "ICONST_2" (int (host.long_to_int (:coerce java/lang/Long +2)) /.iconst_2)) - (_.lift "ICONST_3" (int (host.long_to_int (:coerce java/lang/Long +3)) /.iconst_3)) - (_.lift "ICONST_4" (int (host.long_to_int (:coerce java/lang/Long +4)) /.iconst_4)) - (_.lift "ICONST_5" (int (host.long_to_int (:coerce java/lang/Long +5)) /.iconst_5)) + (_.lift "ICONST_M1" (int (ffi.long_to_int (:coerce java/lang/Long -1)) /.iconst_m1)) + (_.lift "ICONST_0" (int (ffi.long_to_int (:coerce java/lang/Long +0)) /.iconst_0)) + (_.lift "ICONST_1" (int (ffi.long_to_int (:coerce java/lang/Long +1)) /.iconst_1)) + (_.lift "ICONST_2" (int (ffi.long_to_int (:coerce java/lang/Long +2)) /.iconst_2)) + (_.lift "ICONST_3" (int (ffi.long_to_int (:coerce java/lang/Long +3)) /.iconst_3)) + (_.lift "ICONST_4" (int (ffi.long_to_int (:coerce java/lang/Long +4)) /.iconst_4)) + (_.lift "ICONST_5" (int (ffi.long_to_int (:coerce java/lang/Long +5)) /.iconst_5)) (_.lift "LDC_W/INTEGER" (do random.monad [expected ..$Integer::random] @@ -410,7 +410,7 @@ (_.lift "INEG" (unary (function (_ value) ((int/2 "jvm isub" "jvm int -") value - (host.long_to_int (:coerce java/lang/Long +0)))) + (ffi.long_to_int (:coerce java/lang/Long +0)))) /.ineg))) bitwise ($_ _.and (_.lift "IAND" (binary (int/2 "jvm iand" "jvm int and") /.iand)) @@ -463,10 +463,10 @@ (do {! random.monad} [parameter (\ ! map (|>> (n.% 64) (:coerce java/lang/Long)) random.nat) subject ..$Long::random] - (long (reference (host.long_to_int parameter) subject) + (long (reference (ffi.long_to_int parameter) subject) (do /.monad [_ (..$Long::literal subject) - _ (..$Integer::literal (host.long_to_int parameter))] + _ (..$Integer::literal (ffi.long_to_int parameter))] instruction))))) literal ($_ _.and (_.lift "LCONST_0" (long (:coerce java/lang/Long +0) /.lconst_0)) @@ -534,14 +534,14 @@ (<| (..bytecode (for {@.old (function (_ actual) (or (|> actual (:coerce java/lang/Float) ("jvm feq" expected)) - (and (f.not_a_number? (:coerce Frac (host.float_to_double expected))) - (f.not_a_number? (:coerce Frac (host.float_to_double (:coerce java/lang/Float actual))))))) + (and (f.not_a_number? (:coerce Frac (ffi.float_to_double expected))) + (f.not_a_number? (:coerce Frac (ffi.float_to_double (:coerce java/lang/Float actual))))))) @.jvm (function (_ actual) (or (|> actual (:coerce java/lang/Float) "jvm object cast" ("jvm float =" ("jvm object cast" expected))) - (and (f.not_a_number? (:coerce Frac (host.float_to_double expected))) - (f.not_a_number? (:coerce Frac (host.float_to_double (:coerce java/lang/Float actual)))))))})) + (and (f.not_a_number? (:coerce Frac (ffi.float_to_double expected))) + (f.not_a_number? (:coerce Frac (ffi.float_to_double (:coerce java/lang/Float actual)))))))})) (do /.monad [_ bytecode] ..$Float::wrap)))) @@ -568,9 +568,9 @@ _ (..$Float::literal parameter)] instruction))))) literal ($_ _.and - (_.lift "FCONST_0" (float (host.double_to_float (:coerce java/lang/Double +0.0)) /.fconst_0)) - (_.lift "FCONST_1" (float (host.double_to_float (:coerce java/lang/Double +1.0)) /.fconst_1)) - (_.lift "FCONST_2" (float (host.double_to_float (:coerce java/lang/Double +2.0)) /.fconst_2)) + (_.lift "FCONST_0" (float (ffi.double_to_float (:coerce java/lang/Double +0.0)) /.fconst_0)) + (_.lift "FCONST_1" (float (ffi.double_to_float (:coerce java/lang/Double +1.0)) /.fconst_1)) + (_.lift "FCONST_2" (float (ffi.double_to_float (:coerce java/lang/Double +2.0)) /.fconst_2)) (_.lift "LDC_W/FLOAT" (do random.monad [expected ..$Float::random] @@ -584,12 +584,12 @@ (_.lift "FNEG" (unary (function (_ value) ((float/2 "jvm fsub" "jvm float -") value - (host.double_to_float (:coerce java/lang/Double +0.0)))) + (ffi.double_to_float (:coerce java/lang/Double +0.0)))) /.fneg))) comparison (: (-> (Bytecode Any) (-> java/lang/Float java/lang/Float Bit) (Random Bit)) (function (_ instruction standard) (do random.monad - [#let [valid_float (random.filter (|>> host.float_to_double (:coerce Frac) f.not_a_number? not) + [#let [valid_float (random.filter (|>> ffi.float_to_double (:coerce Frac) f.not_a_number? not) ..$Float::random)] reference valid_float subject valid_float @@ -892,8 +892,8 @@ (case (do try.monad [_ (/loader.define class_name bytecode loader) class (io.run (/loader.load class_name loader)) - method (host.try (get_method static_method class)) - output (java/lang/reflect/Method::invoke (host.null) (host.array java/lang/Object 0) method)] + method (ffi.try (get_method static_method class)) + output (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)] (wrap (:coerce Int output))) (#try.Success actual) (i.= (:coerce Int expected) (:coerce Int actual)) @@ -927,7 +927,7 @@ (-> a Any Bit) (Random Bit))) (function (_ size constructor value literal [*store *load *wrap] test) - (let [!index ($Integer::literal (host.long_to_int (:coerce java/lang/Long +0)))] + (let [!index ($Integer::literal (ffi.long_to_int (:coerce java/lang/Long +0)))] (<| (..bytecode (test value)) (do /.monad [_ (!length size) @@ -957,18 +957,18 @@ (array (/.newarray /instruction.t_byte) $Byte::random $Byte::literal [/.bastore /.baload $Byte::wrap] (function (_ expected) (for {@.old - (|>> (:coerce java/lang/Byte) host.byte_to_long ("jvm leq" (host.byte_to_long expected))) + (|>> (:coerce java/lang/Byte) ffi.byte_to_long ("jvm leq" (ffi.byte_to_long expected))) @.jvm - (|>> (:coerce java/lang/Byte) host.byte_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (host.byte_to_long (:coerce java/lang/Byte expected)))))})))) + (|>> (:coerce java/lang/Byte) ffi.byte_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (ffi.byte_to_long (:coerce java/lang/Byte expected)))))})))) (_.context "short" (array (/.newarray /instruction.t_short) $Short::random $Short::literal [/.sastore /.saload $Short::wrap] (function (_ expected) (for {@.old - (|>> (:coerce java/lang/Short) host.short_to_long ("jvm leq" (host.short_to_long expected))) + (|>> (:coerce java/lang/Short) ffi.short_to_long ("jvm leq" (ffi.short_to_long expected))) @.jvm - (|>> (:coerce java/lang/Short) host.short_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (host.short_to_long (:coerce java/lang/Short expected)))))})))) + (|>> (:coerce java/lang/Short) ffi.short_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (ffi.short_to_long (:coerce java/lang/Short expected)))))})))) (_.context "int" (array (/.newarray /instruction.t_int) $Integer::random $Integer::literal [/.iastore /.iaload $Integer::wrap] (function (_ expected) @@ -1028,7 +1028,7 @@ (<| (_.lift "MULTIANEWARRAY") (..bytecode (|>> (:coerce Nat) (n.= sizesH))) (do {! /.monad} - [_ (monad.map ! (|>> (:coerce java/lang/Long) host.long_to_int ..$Integer::literal) + [_ (monad.map ! (|>> (:coerce java/lang/Long) ffi.long_to_int ..$Integer::literal) (#.Cons sizesH sizesT)) _ (/.multianewarray type (|> dimensions /unsigned.u1 try.assume)) _ ?length] @@ -1064,40 +1064,40 @@ ($_ _.and (<| (_.context "int") ($_ _.and - (_.lift "I2L" (conversion ..$Integer::primitive ..$Long::primitive /.i2l (|>> host.int_to_long) long::=)) - (_.lift "I2F" (conversion ..$Integer::primitive ..$Float::primitive /.i2f (|>> host.int_to_float) float::=)) - (_.lift "I2D" (conversion ..$Integer::primitive ..$Double::primitive /.i2d (|>> host.int_to_double) double::=)) - (_.lift "I2B" (conversion ..$Integer::primitive ..$Byte::primitive /.i2b (|>> host.int_to_byte) + (_.lift "I2L" (conversion ..$Integer::primitive ..$Long::primitive /.i2l (|>> ffi.int_to_long) long::=)) + (_.lift "I2F" (conversion ..$Integer::primitive ..$Float::primitive /.i2f (|>> ffi.int_to_float) float::=)) + (_.lift "I2D" (conversion ..$Integer::primitive ..$Double::primitive /.i2d (|>> ffi.int_to_double) double::=)) + (_.lift "I2B" (conversion ..$Integer::primitive ..$Byte::primitive /.i2b (|>> ffi.int_to_byte) (function (_ expected) (for {@.old - (|>> (:coerce java/lang/Byte) host.byte_to_long ("jvm leq" (host.byte_to_long expected))) + (|>> (:coerce java/lang/Byte) ffi.byte_to_long ("jvm leq" (ffi.byte_to_long expected))) @.jvm - (|>> (:coerce java/lang/Byte) host.byte_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (host.byte_to_long (:coerce java/lang/Byte expected)))))})))) - (_.lift "I2C" (conversion ..$Integer::primitive ..$Character::primitive /.i2c (|>> host.int_to_char) + (|>> (:coerce java/lang/Byte) ffi.byte_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (ffi.byte_to_long (:coerce java/lang/Byte expected)))))})))) + (_.lift "I2C" (conversion ..$Integer::primitive ..$Character::primitive /.i2c (|>> ffi.int_to_char) (!::= java/lang/Character "jvm ceq" "jvm char ="))) - (_.lift "I2S" (conversion ..$Integer::primitive ..$Short::primitive /.i2s (|>> host.int_to_short) + (_.lift "I2S" (conversion ..$Integer::primitive ..$Short::primitive /.i2s (|>> ffi.int_to_short) (function (_ expected) (for {@.old - (|>> (:coerce java/lang/Short) host.short_to_long ("jvm leq" (host.short_to_long expected))) + (|>> (:coerce java/lang/Short) ffi.short_to_long ("jvm leq" (ffi.short_to_long expected))) @.jvm - (|>> (:coerce java/lang/Short) host.short_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (host.short_to_long (:coerce java/lang/Short expected)))))})))))) + (|>> (:coerce java/lang/Short) ffi.short_to_long "jvm object cast" ("jvm long =" ("jvm object cast" (ffi.short_to_long (:coerce java/lang/Short expected)))))})))))) (<| (_.context "long") ($_ _.and - (_.lift "L2I" (conversion ..$Long::primitive ..$Integer::primitive /.l2i (|>> host.long_to_int) int::=)) - (_.lift "L2F" (conversion ..$Long::primitive ..$Float::primitive /.l2f (|>> host.long_to_float) float::=)) - (_.lift "L2D" (conversion ..$Long::primitive ..$Double::primitive /.l2d (|>> host.long_to_double) double::=)))) + (_.lift "L2I" (conversion ..$Long::primitive ..$Integer::primitive /.l2i (|>> ffi.long_to_int) int::=)) + (_.lift "L2F" (conversion ..$Long::primitive ..$Float::primitive /.l2f (|>> ffi.long_to_float) float::=)) + (_.lift "L2D" (conversion ..$Long::primitive ..$Double::primitive /.l2d (|>> ffi.long_to_double) double::=)))) (<| (_.context "float") ($_ _.and - (_.lift "F2I" (conversion ..$Float::primitive ..$Integer::primitive /.f2i (|>> host.float_to_int) int::=)) - (_.lift "F2L" (conversion ..$Float::primitive ..$Long::primitive /.f2l (|>> host.float_to_long) long::=)) - (_.lift "F2D" (conversion ..$Float::primitive ..$Double::primitive /.f2d (|>> host.float_to_double) double::=)))) + (_.lift "F2I" (conversion ..$Float::primitive ..$Integer::primitive /.f2i (|>> ffi.float_to_int) int::=)) + (_.lift "F2L" (conversion ..$Float::primitive ..$Long::primitive /.f2l (|>> ffi.float_to_long) long::=)) + (_.lift "F2D" (conversion ..$Float::primitive ..$Double::primitive /.f2d (|>> ffi.float_to_double) double::=)))) (<| (_.context "double") ($_ _.and - (_.lift "D2I" (conversion ..$Double::primitive ..$Integer::primitive /.d2i (|>> host.double_to_int) int::=)) - (_.lift "D2L" (conversion ..$Double::primitive ..$Long::primitive /.d2l (|>> host.double_to_long) long::=)) - (_.lift "D2F" (conversion ..$Double::primitive ..$Float::primitive /.d2f (|>> host.double_to_float) float::=)))) + (_.lift "D2I" (conversion ..$Double::primitive ..$Integer::primitive /.d2i (|>> ffi.double_to_int) int::=)) + (_.lift "D2L" (conversion ..$Double::primitive ..$Long::primitive /.d2l (|>> ffi.double_to_long) long::=)) + (_.lift "D2F" (conversion ..$Double::primitive ..$Float::primitive /.d2f (|>> ffi.double_to_float) float::=)))) ))) (def: value @@ -1156,13 +1156,13 @@ #let [expected (: java/lang/Long (for {@.old ("jvm ladd" - (host.byte_to_long base) + (ffi.byte_to_long base) (.int (/unsigned.value increment))) @.jvm ("jvm object cast" ("jvm long +" - ("jvm object cast" (host.byte_to_long base)) + ("jvm object cast" (ffi.byte_to_long base)) ("jvm object cast" (:coerce java/lang/Long (/unsigned.value increment)))))}))]] (..bytecode (|>> (:coerce Int) (i.= (:coerce Int expected))) (do /.monad @@ -1357,8 +1357,8 @@ loader (/loader.memory (/loader.new_library []))] _ (/loader.define class_name bytecode loader) class (io.run (/loader.load class_name loader)) - method (host.try (get_method object_method_name class))] - (java/lang/reflect/Method::invoke (host.null) (host.array java/lang/Object 0) method)) + method (ffi.try (get_method object_method_name class))] + (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)) (#try.Success actual) (test expected actual) @@ -1498,7 +1498,7 @@ random.nat) choice (\ ! map (n.% options) random.nat) options (|> random.int - (\ ! map (|>> (:coerce java/lang/Long) host.long_to_int host.int_to_long (:coerce Int))) + (\ ! map (|>> (:coerce java/lang/Long) ffi.long_to_int ffi.int_to_long (:coerce Int))) (random.set i.hash options) (\ ! map set.to_list)) #let [choice (maybe.assume (list.nth choice options))] @@ -1509,7 +1509,7 @@ [@right /.new_label @wrong /.new_label @return /.new_label - _ (..$Integer::literal (host.long_to_int (:coerce java/lang/Long choice))) + _ (..$Integer::literal (ffi.long_to_int (:coerce java/lang/Long choice))) _ (/.lookupswitch @wrong (list\map (function (_ option) [(|> option /signed.s4 try.assume) (if (i.= choice option) @right @wrong)]) @@ -1709,8 +1709,8 @@ _ (/loader.define interface_class interface_bytecode loader) _ (/loader.define concrete_class concrete_bytecode loader) class (io.run (/loader.load concrete_class loader)) - method (host.try (get_method static_method class)) - output (java/lang/reflect/Method::invoke (host.null) (host.array java/lang/Object 0) method)] + method (ffi.try (get_method static_method class)) + output (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)] (wrap (:coerce Int output))) (#try.Success actual) (i.= (:coerce Int expected) (:coerce Int actual)) diff --git a/stdlib/source/test/lux/time/instant.lux b/stdlib/source/test/lux/time/instant.lux index 4f6080b48..316ef8783 100644 --- a/stdlib/source/test/lux/time/instant.lux +++ b/stdlib/source/test/lux/time/instant.lux @@ -1,7 +1,7 @@ (.module: [lux #* ["_" test (#+ Test)] - ["." host] + ["." ffi] [abstract [monad (#+ do)] {[0 #spec] @@ -97,7 +97,7 @@ (apply duration.inverse day\pred 6) (apply duration.inverse day\pred 7))))) (_.cover [/.now] - (case (host.try /.now) + (case (ffi.try /.now) (#try.Success _) true |