diff options
author | Eduardo Julian | 2017-10-21 00:38:55 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-21 00:38:55 -0400 |
commit | 0bc56fdc626ee601ca2c4ba0502f76e76d765fa0 (patch) | |
tree | 7abc9bfda606a0b861c9f2b33d9d949f217d8458 /new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux | |
parent | a564de58ec5c91c8069abc3848649a4a0cfd7956 (diff) |
- Updated new compiler to latest version of stdlib.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux | 244 |
1 files changed, 124 insertions, 120 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 ba59500f4..aa0f2388d 100644 --- a/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux +++ b/new-luxc/test/test/luxc/analyser/procedure/host.jvm.lux @@ -249,47 +249,49 @@ (wrap [unboxed boxed])))) (context: "Array." - [#let [cap (|>. (n.% +10) (n.max +1))] - [unboxed boxed] array-type - size (|> r;nat (:: @ map cap)) - idx (|> r;nat (:: @ map (n.% size))) - level (|> r;nat (:: @ map cap)) - #let [unboxedT (#;Host unboxed (list)) - arrayT (#;Host "#Array" (list unboxedT)) - arrayC (`' (_lux_check (+0 "#Array" (+1 (+0 (~ (code;text unboxed)) (+0)) (+0))) - ("jvm array new" (~ (code;nat size))))) - boxedT (#;Host boxed (list)) - boxedTC (` (+0 (~ (code;text boxed)) (+0))) - multi-arrayT (list/fold (function [_ innerT] - (|> innerT (list) (#;Host "#Array"))) - boxedT - (list;n.range +1 level))]] - ($_ seq - (test "jvm array new" - (success "jvm array new" - (list (code;nat size)) - arrayT)) - (test "jvm array new (no nesting)" - (failure "jvm array new" - (list (code;nat size)) - unboxedT)) - (test "jvm array new (nested/multi-level)" - (success "jvm array new" - (list (code;nat size)) - multi-arrayT)) - (test "jvm array length" - (success "jvm array length" - (list arrayC) - Nat)) - (test "jvm array read" - (success "jvm array read" - (list arrayC (code;nat idx)) - boxedT)) - (test "jvm array write" - (success "jvm array write" - (list arrayC (code;nat idx) (`' (_lux_coerce (~ boxedTC) []))) - arrayT)) - )) + (<| (times +100) + (do @ + [#let [cap (|>. (n.% +10) (n.max +1))] + [unboxed boxed] array-type + size (|> r;nat (:: @ map cap)) + idx (|> r;nat (:: @ map (n.% size))) + level (|> r;nat (:: @ map cap)) + #let [unboxedT (#;Primitive unboxed (list)) + arrayT (#;Primitive "#Array" (list unboxedT)) + arrayC (`' (_lux_check (+0 "#Array" (+1 (+0 (~ (code;text unboxed)) (+0)) (+0))) + ("jvm array new" (~ (code;nat size))))) + boxedT (#;Primitive boxed (list)) + boxedTC (` (+0 (~ (code;text boxed)) (+0))) + multi-arrayT (list/fold (function [_ innerT] + (|> innerT (list) (#;Primitive "#Array"))) + boxedT + (list;n.range +1 level))]] + ($_ seq + (test "jvm array new" + (success "jvm array new" + (list (code;nat size)) + arrayT)) + (test "jvm array new (no nesting)" + (failure "jvm array new" + (list (code;nat size)) + unboxedT)) + (test "jvm array new (nested/multi-level)" + (success "jvm array new" + (list (code;nat size)) + multi-arrayT)) + (test "jvm array length" + (success "jvm array length" + (list arrayC) + Nat)) + (test "jvm array read" + (success "jvm array read" + (list arrayC (code;nat idx)) + boxedT)) + (test "jvm array write" + (success "jvm array write" + (list arrayC (code;nat idx) (`' (_lux_coerce (~ boxedTC) []))) + arrayT)) + )))) (def: throwables (List Text) @@ -302,74 +304,76 @@ "java.lang.RuntimeException")) (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 - (:: @ map (n.% (n.inc (list;size throwables)))) - (:: @ map (function [idx] - (|> throwables - (list;nth idx) - (maybe;default "java.lang.Object"))))) - #let [throwableC (`' (_lux_check (+0 (~ (code;text throwable)) (+0)) - ("jvm object null")))]] - ($_ seq - (test "jvm object null" - (success "jvm object null" - (list) - (#;Host boxed (list)))) - (test "jvm object null (no primitives)" - (or (text/= "java.lang.Object" boxed) - (failure "jvm object null" - (list) - (#;Host unboxed (list))))) - (test "jvm object null?" - (success "jvm object null?" - (list boxedC) - Bool)) - (test "jvm object synchronized" - (success "jvm object synchronized" - (list boxedC boxedC) - boxedT)) - (test "jvm object synchronized (no primitives)" - (or (text/= "java.lang.Object" boxed) - (failure "jvm object synchronized" - (list unboxedC boxedC) - boxedT))) - (test "jvm object throw" - (or (text/= "java.lang.Object" throwable) - (success "jvm object throw" - (list throwableC) - Bottom))) - (test "jvm object class" - (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))) - )) + (<| (times +100) + (do @ + [[unboxed boxed] array-type + [!unboxed !boxed] (|> array-type + (r;filter (function [[!unboxed !boxed]] + (not (text/= boxed !boxed))))) + #let [boxedT (#;Primitive 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 + (:: @ map (n.% (n.inc (list;size throwables)))) + (:: @ map (function [idx] + (|> throwables + (list;nth idx) + (maybe;default "java.lang.Object"))))) + #let [throwableC (`' (_lux_check (+0 (~ (code;text throwable)) (+0)) + ("jvm object null")))]] + ($_ seq + (test "jvm object null" + (success "jvm object null" + (list) + (#;Primitive boxed (list)))) + (test "jvm object null (no primitives)" + (or (text/= "java.lang.Object" boxed) + (failure "jvm object null" + (list) + (#;Primitive unboxed (list))))) + (test "jvm object null?" + (success "jvm object null?" + (list boxedC) + Bool)) + (test "jvm object synchronized" + (success "jvm object synchronized" + (list boxedC boxedC) + boxedT)) + (test "jvm object synchronized (no primitives)" + (or (text/= "java.lang.Object" boxed) + (failure "jvm object synchronized" + (list unboxedC boxedC) + boxedT))) + (test "jvm object throw" + (or (text/= "java.lang.Object" throwable) + (success "jvm object throw" + (list throwableC) + Bottom))) + (test "jvm object class" + (success "jvm object class" + (list (code;text boxed)) + (#;Primitive "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 [Static Field]." ($_ seq @@ -377,12 +381,12 @@ (success "jvm member static get" (list (code;text "java.lang.System") (code;text "out")) - (#;Host "java.io.PrintStream" (list)))) + (#;Primitive "java.io.PrintStream" (list)))) (test "jvm member static get (inheritance out)" (success "jvm member static get" (list (code;text "java.lang.System") (code;text "out")) - (#;Host "java.lang.Object" (list)))) + (#;Primitive "java.lang.Object" (list)))) (test "jvm member static put" (success "jvm member static put" (list (code;text "java.awt.datatransfer.DataFlavor") @@ -414,14 +418,14 @@ (code;text "id") (`' (_lux_check (+0 "org.omg.CORBA.ValueMember" (+0)) ("jvm object null")))) - (#;Host "java.lang.String" (list)))) + (#;Primitive "java.lang.String" (list)))) (test "jvm member virtual get (inheritance out)" (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.Object" (list)))) + (#;Primitive "java.lang.Object" (list)))) (test "jvm member virtual put" (success "jvm member virtual put" (list (code;text "org.omg.CORBA.ValueMember") @@ -457,14 +461,14 @@ (success "jvm member static get" (list (code;text "java.util.GregorianCalendar") (code;text "AD")) - (#;Host "java.lang.Integer" (list)))) + (#;Primitive "java.lang.Integer" (list)))) (test "jvm member virtual get" (success "jvm member virtual get" (list (code;text "javax.accessibility.AccessibleAttributeSequence") (code;text "startIndex") (`' (_lux_check (+0 "javax.accessibility.AccessibleAttributeSequence" (+0)) ("jvm object null")))) - (#;Host "java.lang.Integer" (list)))) + (#;Primitive "java.lang.Integer" (list)))) (test "jvm member virtual put" (success "jvm member virtual put" (list (code;text "javax.accessibility.AccessibleAttributeSequence") @@ -491,7 +495,7 @@ (code;tuple (list (' "java.lang.String") (' (_lux_coerce (+0 "java.lang.String" (+0)) "YOLO"))))) - (#;Host "java.lang.Long" (list)))) + (#;Primitive "java.lang.Long" (list)))) (test "jvm member invoke virtual" (success "jvm member invoke virtual" (list (code;text "java.lang.Object") @@ -499,7 +503,7 @@ longC (code;tuple (list (' "java.lang.Object") longC))) - (#;Host "java.lang.Boolean" (list)))) + (#;Primitive "java.lang.Boolean" (list)))) (test "jvm member invoke special" (success "jvm member invoke special" (list (code;text "java.lang.Long") @@ -507,7 +511,7 @@ longC (code;tuple (list (' "java.lang.Object") longC))) - (#;Host "java.lang.Boolean" (list)))) + (#;Primitive "java.lang.Boolean" (list)))) (test "jvm member invoke interface" (success "jvm member invoke interface" (list (code;text "java.util.Collection") @@ -515,10 +519,10 @@ objectC (code;tuple (list (' "java.lang.Object") longC))) - (#;Host "java.lang.Boolean" (list)))) + (#;Primitive "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))))) + (All [a] (#;Primitive "java.util.ArrayList" (list a))))) ))) |