aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/host.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-01-03 07:48:12 -0400
committerEduardo Julian2021-01-03 07:48:12 -0400
commitc03bd9f9787fb9f383c57b4ebb0fa9d49abbfaa1 (patch)
tree68a7f2f043eff00492ffe2b5e442bae98167a873 /stdlib/source/test/lux/host.jvm.lux
parent02d27daeacac74785c2b0f4d1ce03d432377a36e (diff)
Place the "program:" macro of "lux/control/parser/cli" in its own module.
Diffstat (limited to 'stdlib/source/test/lux/host.jvm.lux')
-rw-r--r--stdlib/source/test/lux/host.jvm.lux43
1 files changed, 23 insertions, 20 deletions
diff --git a/stdlib/source/test/lux/host.jvm.lux b/stdlib/source/test/lux/host.jvm.lux
index 2532b3075..9edaecd0c 100644
--- a/stdlib/source/test/lux/host.jvm.lux
+++ b/stdlib/source/test/lux/host.jvm.lux
@@ -21,19 +21,22 @@
(import: java/lang/String)
(import: java/lang/Exception
- (new [java/lang/String]))
+ ["#::."
+ (new [java/lang/String])])
(import: java/lang/Object)
(import: (java/lang/Class a)
- (getName [] java/lang/String))
+ ["#::."
+ (getName [] java/lang/String)])
(import: java/lang/Runnable)
(import: java/lang/System
- (#static out java/io/PrintStream)
- (#static currentTimeMillis [] #io long)
- (#static getenv [java/lang/String] #io #? java/lang/String))
+ ["#::."
+ (#static out java/io/PrintStream)
+ (#static currentTimeMillis [] #io long)
+ (#static getenv [java/lang/String] #io #? java/lang/String)])
## TODO: Handle "class:" ASAP.
## (class: #final (TestClass A) [java/lang/Runnable]
@@ -54,14 +57,14 @@
## (java/lang/Runnable [] (run self) void
## []))
-(def: test-runnable
+(def: test_runnable
(object [] [java/lang/Runnable]
[]
(java/lang/Runnable
[] (run self) void
[])))
-(def: test-callable
+(def: test_callable
(object [a] [(java/util/concurrent/Callable a)]
[]
((java/util/concurrent/Callable a)
@@ -79,15 +82,15 @@
(~~ (template [<to> <from> <message>]
[(_.test <message>
(or (|> sample (:coerce java/lang/Long) <to> <from> (:coerce Int) (i.= sample))
- (let [capped-sample (|> sample (:coerce java/lang/Long) <to> <from>)]
- (|> capped-sample <to> <from> (:coerce Int) (i.= (:coerce Int capped-sample))))))]
-
- [/.long-to-byte /.byte-to-long "Can succesfully convert to/from byte."]
- [/.long-to-short /.short-to-long "Can succesfully convert to/from short."]
- [/.long-to-int /.int-to-long "Can succesfully convert to/from int."]
- [/.long-to-float /.float-to-long "Can succesfully convert to/from float."]
- [/.long-to-double /.double-to-long "Can succesfully convert to/from double."]
- [(<| /.int-to-char /.long-to-int) (<| /.int-to-long /.char-to-int) "Can succesfully convert to/from char."]
+ (let [capped_sample (|> sample (:coerce java/lang/Long) <to> <from>)]
+ (|> capped_sample <to> <from> (:coerce Int) (i.= (:coerce Int capped_sample))))))]
+
+ [/.long_to_byte /.byte_to_long "Can succesfully convert to/from byte."]
+ [/.long_to_short /.short_to_long "Can succesfully convert to/from short."]
+ [/.long_to_int /.int_to_long "Can succesfully convert to/from int."]
+ [/.long_to_float /.float_to_long "Can succesfully convert to/from float."]
+ [/.long_to_double /.double_to_long "Can succesfully convert to/from double."]
+ [(<| /.int_to_char /.long_to_int) (<| /.int_to_long /.char_to_int) "Can succesfully convert to/from char."]
))
))))
@@ -107,7 +110,7 @@
(/.synchronized sample #1))
(_.test "Can access Class instances."
- (text\= "java.lang.Class" (java/lang/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))
@@ -130,13 +133,13 @@
value (\ ! map (|>> (:coerce java/lang/Long)) r.int)]
($_ _.and
(_.test "Can create arrays of some length."
- (n.= size (/.array-length (/.array java/lang/Long size))))
+ (n.= size (/.array_length (/.array java/lang/Long size))))
(_.test "Can set and get array values."
(let [arr (/.array java/lang/Long size)]
- (exec (/.array-write idx value arr)
+ (exec (/.array_write idx value arr)
(i.= (:coerce Int value)
- (:coerce Int (/.array-read idx arr)))))))))
+ (:coerce Int (/.array_read idx arr)))))))))
(def: #export test
($_ _.and