diff options
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux/host.jvm.lux | 56 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/phase/analysis.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/phase/extension/analysis/lux.lux (renamed from stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux) | 0 |
3 files changed, 32 insertions, 28 deletions
diff --git a/stdlib/source/test/lux/host.jvm.lux b/stdlib/source/test/lux/host.jvm.lux index c9446b857..f142a1912 100644 --- a/stdlib/source/test/lux/host.jvm.lux +++ b/stdlib/source/test/lux/host.jvm.lux @@ -11,28 +11,32 @@ {1 ["." / (#+ import: class: interface: object)]}) -(import: (java/util/concurrent/Callable a)) +(import: #long (java/util/concurrent/Callable a)) -(import: java/lang/Exception - (new [String])) +(import: #long java/lang/String) -(import: java/lang/Object) +(import: #long java/lang/Exception + (new [java/lang/String])) -(import: (java/lang/Class a) - (getName [] String)) +(import: #long java/lang/Object) -(import: java/lang/System +(import: #long (java/lang/Class a) + (getName [] java/lang/String)) + +(import: #long java/lang/Runnable) + +(import: #long java/lang/System (#static out java/io/PrintStream) (#static currentTimeMillis [] #io long) - (#static getenv [String] #io #? String)) + (#static getenv [java/lang/String] #io #? java/lang/String)) -(class: #final (TestClass A) [Runnable] +(class: #final (TestClass A) [java/lang/Runnable] ## Fields (#private foo boolean) (#private bar A) (#private baz java/lang/Object) ## Methods - (#public [] (new {value A}) [] + (#public [] (new self {value A}) [] (exec (:= ::foo #1) (:= ::bar value) (:= ::baz "") @@ -41,23 +45,23 @@ "") (#public #static (static) java/lang/Object "") - (Runnable [] (run self) void - [])) + (java/lang/Runnable [] (run self) void + [])) (def: test-runnable - (object [] [Runnable] + (object [] [java/lang/Runnable] [] - (Runnable [] (run self) void - []))) + (java/lang/Runnable [] (run self) void + []))) (def: test-callable - (object [a] [(Callable a)] + (object [a] [(java/util/concurrent/Callable a)] [] - (Callable [] (call self) a - (undefined)))) + (java/util/concurrent/Callable [] (call self) a + (undefined)))) (interface: TestInterface - ([] foo [boolean String] void #throws [Exception])) + ([] foo [boolean java/lang/String] void #throws [java/lang/Exception])) (def: conversions Test @@ -85,26 +89,26 @@ [sample (r.ascii 1)] ($_ _.and (_.test "Can check if an object is of a certain class." - (and (case (/.check String sample) (#.Some _) true #.None false) - (case (/.check Long sample) (#.Some _) false #.None true) - (case (/.check Object sample) (#.Some _) true #.None false) - (case (/.check Object (/.null)) (#.Some _) false #.None true))) + (and (case (/.check java/lang/String sample) (#.Some _) true #.None false) + (case (/.check java/lang/Long sample) (#.Some _) false #.None true) + (case (/.check java/lang/Object sample) (#.Some _) true #.None false) + (case (/.check java/lang/Object (/.null)) (#.Some _) false #.None true))) (_.test "Can run code in a 'synchronized' block." (/.synchronized sample #1)) (_.test "Can access Class instances." - (text;= "java.lang.Class" (Class::getName (/.class-for java/lang/Class)))) + (text;= "java.lang.Class" (java/lang/Class::getName (/.class-for java/lang/Class)))) (_.test "Can check if a value is null." (and (/.null? (/.null)) (not (/.null? sample)))) (_.test "Can safely convert nullable references into Maybe values." - (and (|> (: (Maybe Object) (/.??? (/.null))) + (and (|> (: (Maybe java/lang/Object) (/.??? (/.null))) (case> #.None #1 _ #0)) - (|> (: (Maybe Object) (/.??? sample)) + (|> (: (Maybe java/lang/Object) (/.??? sample)) (case> (#.Some _) #1 _ #0)))) ))) diff --git a/stdlib/source/test/lux/tool/compiler/phase/analysis.lux b/stdlib/source/test/lux/tool/compiler/phase/analysis.lux index d24feb8be..06b09fbf9 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/analysis.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/analysis.lux @@ -10,7 +10,7 @@ ["/#" // #_ [extension [analysis - ["#." common]]]]]) + ["#." lux]]]]]) (def: #export test Test @@ -20,5 +20,5 @@ /reference.test /case.test /function.test - //common.test + //lux.test )) diff --git a/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux b/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/lux.lux index e45656025..e45656025 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/lux.lux |