aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
authorEduardo Julian2018-07-31 22:23:07 -0400
committerEduardo Julian2018-07-31 22:23:07 -0400
commit97ab1f076ac08992d6b64cd77bc0bef97b3fc50a (patch)
tree6ea01c3e9f5be6a1387c1a7621681d1642176329 /new-luxc/test
parent7e44ee8a2cfb14e35f6283a9eb8d6a2ddc8bd99a (diff)
Now implementing array functionality in stdlib instead of the compiler.
Diffstat (limited to 'new-luxc/test')
-rw-r--r--new-luxc/test/test/luxc/lang/translation/common.lux54
1 files changed, 0 insertions, 54 deletions
diff --git a/new-luxc/test/test/luxc/lang/translation/common.lux b/new-luxc/test/test/luxc/lang/translation/common.lux
index 7fe49fae2..03e56fa18 100644
--- a/new-luxc/test/test/luxc/lang/translation/common.lux
+++ b/new-luxc/test/test/luxc/lang/translation/common.lux
@@ -274,59 +274,6 @@
#0)))
)))
-(def: (array-spec run)
- (-> Runner Test)
- (do r.Monad<Random>
- [size (|> r.nat (:: @ map (|>> (n/% 10) (n/max 1))))
- idx (|> r.nat (:: @ map (n/% size)))
- value r.nat
- #let [array0S (#synthesis.Extension "lux array new"
- (list (synthesis.i64 size)))
- array1S (#synthesis.Extension "lux array put"
- (list array0S
- (synthesis.i64 idx)
- (synthesis.i64 value)))]]
- ($_ seq
- (test "Can get size of array."
- (|> (run (#synthesis.Extension "lux array size"
- (list array0S)))
- (case> (#e.Success valueV)
- (n/= size (:coerce Nat valueV))
-
- (#e.Error error)
- (exec (log! error)
- #0))))
- (test "Can get element from array (if it exists)."
- (and (|> (run (#synthesis.Extension "lux array get"
- (list array0S (synthesis.i64 idx))))
- (case> (^multi (#e.Success valueV)
- [(:coerce (Maybe Nat) valueV) #.None])
- #1
-
- _
- #0))
- (|> (run (#synthesis.Extension "lux array get"
- (list array1S (synthesis.i64 idx))))
- (case> (^multi (#e.Success valueV)
- [(:coerce (Maybe Nat) valueV) (#.Some valueV)])
- (n/= value valueV)
-
- _
- #0))))
- (test "Can remove element from array."
- (|> (run (#synthesis.Extension "lux array get"
- (list (#synthesis.Extension "lux array remove"
- (list array1S
- (synthesis.i64 idx)))
- (synthesis.i64 idx))))
- (case> (^multi (#e.Success valueV)
- [(:coerce (Maybe Nat) valueV) #.None])
- #1
-
- _
- #0)))
- )))
-
(def: (io-spec run)
(-> Runner Test)
(do r.Monad<Random>
@@ -421,7 +368,6 @@
(i64-spec run)
(f64-spec run)
(text-spec run)
- (array-spec run)
(io-spec run)
(box-spec run)
))