diff options
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/host.jvm.lux | 29 | ||||
-rw-r--r-- | stdlib/test/test/lux/world/blob.lux | 28 |
2 files changed, 28 insertions, 29 deletions
diff --git a/stdlib/test/test/lux/host.jvm.lux b/stdlib/test/test/lux/host.jvm.lux index 064b4c360..7025bdc2a 100644 --- a/stdlib/test/test/lux/host.jvm.lux +++ b/stdlib/test/test/lux/host.jvm.lux @@ -11,18 +11,18 @@ ["r" math/random]) lux/test) -(&;import (java.util.concurrent.Callable a)) +(&;import (java/util/concurrent/Callable a)) -(&;import java.lang.Exception +(&;import java/lang/Exception (new [String])) -(&;import java.lang.Object) +(&;import java/lang/Object) -(&;import (java.lang.Class a) +(&;import (java/lang/Class a) (getName [] String)) -(&;import java.lang.System - (#static out java.io.PrintStream) +(&;import java/lang/System + (#static out java/io/PrintStream) (#static currentTimeMillis [] #io long) (#static getenv [String] #io #? String)) @@ -30,20 +30,19 @@ ## Fields (#private foo boolean) (#private bar A) - (#private baz java.lang.Object) + (#private baz java/lang/Object) ## Methods (#public [] (new [value A]) [] - (exec (:= .foo true) - (:= .bar value) - (:= .baz "") + (exec (:= ::foo true) + (:= ::bar value) + (:= ::baz "") [])) - (#public (virtual) java.lang.Object + (#public (virtual) java/lang/Object "") - (#public #static (static) java.lang.Object + (#public #static (static) java/lang/Object "") (Runnable [] (run) void - []) - ) + [])) (def: test-runnable (object [] [Runnable] @@ -94,7 +93,7 @@ (&;synchronized "" true)) (test "Can access Class instances." - (text/= "java.lang.Class" (Class.getName [] (&;class-for java.lang.Class)))) + (text/= "java.lang.Class" (Class::getName [] (&;class-for java/lang/Class)))) (test "Can check if a value is null." (and (&;null? (&;null)) diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux index 90d2a9af0..c478818c0 100644 --- a/stdlib/test/test/lux/world/blob.lux +++ b/stdlib/test/test/lux/world/blob.lux @@ -4,19 +4,19 @@ (control [monad #+ do] [pipe]) (data [bit] - ["E" error] + ["e" error] (coll [list])) (world ["@" blob]) ["r" math/random]) lux/test) (def: (succeed result) - (-> (E;Error Bool) Bool) + (-> (e;Error Bool) Bool) (case result - (#E;Error _) + (#e;Error _) false - (#E;Success output) + (#e;Success output) output)) (def: #export (blob size) @@ -28,7 +28,7 @@ (if (n/< size idx) (do @ [byte r;nat] - (exec (E;assume (@;write-8 idx byte blob)) + (exec (e;assume (@;write-8 idx byte blob)) (recur (n/inc idx)))) (wrap blob)))))) @@ -54,39 +54,39 @@ value-32 (n/% (bit;shift-left +32 +1) value) value-64 value slice-size (|> to (n/- from) n/inc) - random-slice (E;assume (@;slice from to random-blob))]] + random-slice (e;assume (@;slice from to random-blob))]] ($_ seq (test "Has equality." (and (:: @;Eq<Blob> = clean-blob clean-blob) (:: @;Eq<Blob> = - (E;assume (@;slice from to clean-blob)) - (E;assume (@;slice from to clean-blob))))) + (e;assume (@;slice from to clean-blob)) + (e;assume (@;slice from to clean-blob))))) (test "Can get size of blob." (n/= blob-size size)) (test "Can read/write 8-bit values." (succeed - (do E;Monad<Error> + (do e;Monad<Error> [_ (@;write-8 idx value-8 clean-blob) output-8 (@;read-8 idx clean-blob)] (wrap (n/= value-8 output-8))))) (test "Can read/write 16-bit values." (or (n/>= size (n/+ +1 idx)) (succeed - (do E;Monad<Error> + (do e;Monad<Error> [_ (@;write-16 idx value-16 clean-blob) output-16 (@;read-16 idx clean-blob)] (wrap (n/= value-16 output-16)))))) (test "Can read/write 32-bit values." (or (n/>= size (n/+ +3 idx)) (succeed - (do E;Monad<Error> + (do e;Monad<Error> [_ (@;write-32 idx value-32 clean-blob) output-32 (@;read-32 idx clean-blob)] (wrap (n/= value-32 output-32)))))) (test "Can read/write 64-bit values." (or (n/>= size (n/+ +7 idx)) (succeed - (do E;Monad<Error> + (do e;Monad<Error> [_ (@;write-64 idx value-64 clean-blob) output-64 (@;read-64 idx clean-blob)] (wrap (n/= value-64 output-64)))))) @@ -96,7 +96,7 @@ (let [loop-recur recur] (if (n/< slice-size idx) (and (succeed - (do E;Monad<Error> + (do e;Monad<Error> [reference (@;read-8 (n/+ from idx) random-blob) sample (@;read-8 idx random-slice)] (wrap (n/= reference sample)))) @@ -105,5 +105,5 @@ (test "Slicing the whole blob does not change anything." (:: @;Eq<Blob> = random-blob - (E;assume (@;slice +0 (n/dec blob-size) random-blob)))) + (e;assume (@;slice +0 (n/dec blob-size) random-blob)))) )))) |