From aa7f1d12ae98da9726bf8bbdd3c494a671e3f94b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 27 Apr 2019 21:58:14 -0400 Subject: Moved the modules under "lux/host/" to now be under "lux/target/". --- stdlib/source/test/lux.lux | 9 ++-- stdlib/source/test/lux/host/jvm.old.lux | 89 ------------------------------- stdlib/source/test/lux/target/jvm.old.lux | 89 +++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 93 deletions(-) delete mode 100644 stdlib/source/test/lux/host/jvm.old.lux create mode 100644 stdlib/source/test/lux/target/jvm.old.lux (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 5c5051a2c..a881dae3f 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -35,7 +35,7 @@ [format [css (#+)] [markdown (#+)]]] - [host + [target [js (#+)] [python (#+)] [lua (#+)] @@ -122,7 +122,8 @@ ["#." tool] ["#." type] ["#." world] - ["#." host + ["#." host] + ["#." target #_ ["#/." jvm]]] )) @@ -343,9 +344,9 @@ /tool.test /type.test /world.test + /host.test ($_ _.and - /host.test - /host/jvm.test) + /target/jvm.test) ))) (program: args diff --git a/stdlib/source/test/lux/host/jvm.old.lux b/stdlib/source/test/lux/host/jvm.old.lux deleted file mode 100644 index 47c6f35d9..000000000 --- a/stdlib/source/test/lux/host/jvm.old.lux +++ /dev/null @@ -1,89 +0,0 @@ -(.module: - [lux #* - [abstract/monad (#+ do)] - [control - ["." io (#+ IO)] - [concurrency - ["." atom]] - [security - ["!" capability]]] - [data - ["." error (#+ Error)] - ["." text - format] - [format - ["." binary]] - [collection - ["." dictionary] - ["." row]]] - [world - ["." file (#+ File)] - [binary (#+ Binary)]] - [math - ["r" random]] - ["_" test (#+ Test)]] - {1 - ["." / #_ - ["#." loader (#+ Library)] - ["#." version] - ["#." name] - ["#." descriptor] - ["#." field] - ["#." class] - [modifier - ["#.M" inner]]]}) - -(def: (write-class! name bytecode) - (-> Text Binary (IO Text)) - (let [file-path (format name ".class")] - (do io.monad - [outcome (do (error.with @) - [file (: (IO (Error (File IO))) - (file.get-file io.monad file.system file-path))] - (!.use (:: file over-write) bytecode))] - (wrap (case outcome - (#error.Success definition) - (format "Wrote: " (%t file-path)) - - (#error.Failure error) - error))))) - -(def: class - Test - (do r.monad - [_ (wrap []) - #let [package "my.package" - name "MyClass" - full-name (format package "." name) - input (/class.class /version.v6_0 /class.public - (/name.internal "java.lang.Object") - (/name.internal full-name) - (list (/name.internal "java.io.Serializable") - (/name.internal "java.lang.Runnable")) - (list (/field.field /field.public "foo" /descriptor.long (row.row)) - (/field.field /field.public "bar" /descriptor.double (row.row))) - (row.row) - (row.row)) - bytecode (binary.write /class.format input) - loader (/loader.memory (/loader.new-library []))]] - ($_ _.and - (_.test "Can read a generated class." - (case (binary.read /class.format bytecode) - (#error.Success output) - (:: /class.equivalence = input output) - - (#error.Failure error) - false)) - (_.test "Can generate a class." - (case (/loader.define full-name bytecode loader) - (#error.Success definition) - true - - (#error.Failure error) - false)) - ))) - -(def: #export test - Test - (<| (_.context "Class") - ..class)) diff --git a/stdlib/source/test/lux/target/jvm.old.lux b/stdlib/source/test/lux/target/jvm.old.lux new file mode 100644 index 000000000..47c6f35d9 --- /dev/null +++ b/stdlib/source/test/lux/target/jvm.old.lux @@ -0,0 +1,89 @@ +(.module: + [lux #* + [abstract/monad (#+ do)] + [control + ["." io (#+ IO)] + [concurrency + ["." atom]] + [security + ["!" capability]]] + [data + ["." error (#+ Error)] + ["." text + format] + [format + ["." binary]] + [collection + ["." dictionary] + ["." row]]] + [world + ["." file (#+ File)] + [binary (#+ Binary)]] + [math + ["r" random]] + ["_" test (#+ Test)]] + {1 + ["." / #_ + ["#." loader (#+ Library)] + ["#." version] + ["#." name] + ["#." descriptor] + ["#." field] + ["#." class] + [modifier + ["#.M" inner]]]}) + +(def: (write-class! name bytecode) + (-> Text Binary (IO Text)) + (let [file-path (format name ".class")] + (do io.monad + [outcome (do (error.with @) + [file (: (IO (Error (File IO))) + (file.get-file io.monad file.system file-path))] + (!.use (:: file over-write) bytecode))] + (wrap (case outcome + (#error.Success definition) + (format "Wrote: " (%t file-path)) + + (#error.Failure error) + error))))) + +(def: class + Test + (do r.monad + [_ (wrap []) + #let [package "my.package" + name "MyClass" + full-name (format package "." name) + input (/class.class /version.v6_0 /class.public + (/name.internal "java.lang.Object") + (/name.internal full-name) + (list (/name.internal "java.io.Serializable") + (/name.internal "java.lang.Runnable")) + (list (/field.field /field.public "foo" /descriptor.long (row.row)) + (/field.field /field.public "bar" /descriptor.double (row.row))) + (row.row) + (row.row)) + bytecode (binary.write /class.format input) + loader (/loader.memory (/loader.new-library []))]] + ($_ _.and + (_.test "Can read a generated class." + (case (binary.read /class.format bytecode) + (#error.Success output) + (:: /class.equivalence = input output) + + (#error.Failure error) + false)) + (_.test "Can generate a class." + (case (/loader.define full-name bytecode loader) + (#error.Success definition) + true + + (#error.Failure error) + false)) + ))) + +(def: #export test + Test + (<| (_.context "Class") + ..class)) -- cgit v1.2.3