aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
authorEduardo Julian2017-10-08 00:52:57 -0400
committerEduardo Julian2017-10-08 00:52:57 -0400
commit272b8960b1247d04e1e1bdec6e0269114d5d1844 (patch)
treea361bf85e9aedf5f12b1f3d30a73f28beb4c3680 /new-luxc/test
parent39170dd3514cbca9299146af8965f2764ba0fb4a (diff)
- WIP: JVM field analysis.
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))
))