diff options
author | Eduardo Julian | 2018-12-28 23:37:36 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-12-28 23:37:36 -0400 |
commit | 6cb445ad8bd6c4d3db62250d9626a9a4e228d84d (patch) | |
tree | 83f5df32f158a687fc493b029fcd305adfcd3b2d /stdlib/test | |
parent | cc18830e230ea44960fb931058f7acd9f19f62bb (diff) |
Added equivalences.
Diffstat (limited to '')
-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))) + ))) |