diff options
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/host/jvm.jvm.lux | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/stdlib/test/test/lux/host/jvm.jvm.lux b/stdlib/test/test/lux/host/jvm.jvm.lux index 309deb800..b293c811f 100644 --- a/stdlib/test/test/lux/host/jvm.jvm.lux +++ b/stdlib/test/test/lux/host/jvm.jvm.lux @@ -22,6 +22,7 @@ ["/." loader (#+ Library)] ["/." version] ["/." name] + ["/." descriptor] ["/." field] ["/." class] [modifier @@ -43,42 +44,42 @@ (format "Wrote: " (%t file-path)) (#error.Failure error) - error))))) + ## TODO: Remove 'log!' call. + (exec (log! error) + error)))))) (context: "Class" (let [package "my.package" name "MyClass" full-name (format package "." name) - class (/class.class /version.v6_0 /class.public + 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")) - (row.row) + (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 class) + bytecode (binary.write /class.format input) loader (/loader.memory (/loader.new-library []))] - (exec - ## TODO: Remove 'write-class' call. - (io.run (..write-class name)) - ($_ seq - (test "Can read a generated class." - (case (binary.read /class.format bytecode) - (#error.Success class) - true - - (#error.Failure error) - ## TODO: Remove 'log!' call. - (exec (log! error) - false))) - (test "Can generate a class." - (case (/loader.define full-name bytecode loader) - (#error.Success definition) - true - - (#error.Failure error) - ## TODO: Remove 'log!' call. - (exec (log! error) - false))) - )))) + ($_ seq + (test "Can read a generated class." + (case (binary.read /class.format bytecode) + (#error.Success output) + (:: /class.Equivalence<Class> = input output) + + (#error.Failure error) + ## TODO: Remove 'log!' call. + (exec (log! error) + false))) + (test "Can generate a class." + (case (/loader.define full-name bytecode loader) + (#error.Success definition) + true + + (#error.Failure error) + ## TODO: Remove 'log!' call. + (exec (log! error) + false))) + ))) |