diff options
Diffstat (limited to 'new-luxc/test')
-rw-r--r-- | new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux | 47 |
1 files changed, 47 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 5cf359ad0..ba59500f4 100644 --- a/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux +++ b/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux @@ -475,3 +475,50 @@ ("jvm object null")))) Unit)) )) + +(context: "Member [Method]." + (let [longC (' (_lux_coerce (+0 "java.lang.Long" (+0)) + +123)) + intC (`' ("jvm convert long-to-int" (~ longC))) + objectC (`' (_lux_check (+0 "java.util.ArrayList" (+1 (+0 "java.lang.Long" (+0)) (+0))) + ("jvm member invoke constructor" "java.util.ArrayList" + ["int" (~ intC)])))] + ($_ seq + (test "jvm member invoke static" + (success "jvm member invoke static" + (list (code;text "java.lang.Long") + (code;text "decode") + (code;tuple (list (' "java.lang.String") + (' (_lux_coerce (+0 "java.lang.String" (+0)) + "YOLO"))))) + (#;Host "java.lang.Long" (list)))) + (test "jvm member invoke virtual" + (success "jvm member invoke virtual" + (list (code;text "java.lang.Object") + (code;text "equals") + longC + (code;tuple (list (' "java.lang.Object") + longC))) + (#;Host "java.lang.Boolean" (list)))) + (test "jvm member invoke special" + (success "jvm member invoke special" + (list (code;text "java.lang.Long") + (code;text "equals") + longC + (code;tuple (list (' "java.lang.Object") + longC))) + (#;Host "java.lang.Boolean" (list)))) + (test "jvm member invoke interface" + (success "jvm member invoke interface" + (list (code;text "java.util.Collection") + (code;text "add") + objectC + (code;tuple (list (' "java.lang.Object") + longC))) + (#;Host "java.lang.Boolean" (list)))) + (test "jvm member invoke constructor" + (success "jvm member invoke constructor" + (list (code;text "java.util.ArrayList") + (code;tuple (list (' "int") intC))) + (All [a] (#;Host "java.util.ArrayList" (list a))))) + ))) |