aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/test')
-rw-r--r--new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux69
1 files changed, 69 insertions, 0 deletions
diff --git a/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux b/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux
index eec4ec723..b2aad9dd1 100644
--- a/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux
+++ b/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux
@@ -305,9 +305,14 @@
(context: "Object."
[[unboxed boxed] array-type
+ [!unboxed !boxed] (|> array-type
+ (r;filter (function [[!unboxed !boxed]]
+ (not (text/= boxed !boxed)))))
#let [boxedT (#;Host boxed (list))
boxedC (`' (_lux_check (+0 (~ (code;text boxed)) (+0))
("jvm object null")))
+ !boxedC (`' (_lux_check (+0 (~ (code;text !boxed)) (+0))
+ ("jvm object null")))
unboxedC (`' (_lux_check (+0 (~ (code;text unboxed)) (+0))
("jvm object null")))]
throwable (|> r;nat
@@ -350,4 +355,68 @@
(success "jvm object class"
(list (code;text boxed))
(#;Host "java.lang.Class" (list boxedT))))
+ (test "jvm object instance?"
+ (success "jvm object instance?"
+ (list (code;text boxed)
+ boxedC)
+ Bool))
+ (test "jvm object instance? (lineage)"
+ (success "jvm object instance?"
+ (list (' "java.lang.Object")
+ boxedC)
+ Bool))
+ (test "jvm object instance? (no lineage)"
+ (or (text/= "java.lang.Object" boxed)
+ (failure "jvm object instance?"
+ (list (code;text boxed)
+ !boxedC)
+ Bool)))
+ ))
+
+(context: "Member [Field]."
+ ($_ seq
+ (test "jvm member static get"
+ (success "jvm member static get"
+ (list (code;text "java.lang.System")
+ (code;text "out"))
+ (#;Host "java.io.PrintStream" (list))))
+ (test "jvm member static put"
+ (success "jvm member static put"
+ (list (code;text "java.awt.datatransfer.DataFlavor")
+ (code;text "allHtmlFlavor")
+ (`' (_lux_check (+0 "java.awt.datatransfer.DataFlavor" (+0))
+ ("jvm object null"))))
+ Unit))
+ (test "jvm member static put (final)"
+ (failure "jvm member static put"
+ (list (code;text "java.lang.System")
+ (code;text "out")
+ (`' (_lux_check (+0 "java.io.PrintStream" (+0))
+ ("jvm object null"))))
+ Unit))
+ (test "jvm member virtual get"
+ (success "jvm member virtual get"
+ (list (code;text "org.omg.CORBA.ValueMember")
+ (code;text "id")
+ (`' (_lux_check (+0 "org.omg.CORBA.ValueMember" (+0))
+ ("jvm object null"))))
+ (#;Host "java.lang.String" (list))))
+ (test "jvm member virtual put"
+ (success "jvm member virtual put"
+ (list (code;text "org.omg.CORBA.ValueMember")
+ (code;text "id")
+ (`' (_lux_check (+0 "java.lang.String" (+0))
+ ("jvm object null")))
+ (`' (_lux_check (+0 "org.omg.CORBA.ValueMember" (+0))
+ ("jvm object null"))))
+ Unit))
+ (test "jvm member virtual put (final)"
+ (failure "jvm member virtual put"
+ (list (code;text "javax.swing.text.html.parser.DTD")
+ (code;text "applet")
+ (`' (_lux_check (+0 "javax.swing.text.html.parser.Element" (+0))
+ ("jvm object null")))
+ (`' (_lux_check (+0 "javax.swing.text.html.parser.DTD" (+0))
+ ("jvm object null"))))
+ Unit))
))