From 97ab1f076ac08992d6b64cd77bc0bef97b3fc50a Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 31 Jul 2018 22:23:07 -0400 Subject: Now implementing array functionality in stdlib instead of the compiler. --- .../test/test/luxc/lang/translation/common.lux | 54 ---------------------- 1 file changed, 54 deletions(-) (limited to 'new-luxc/test') 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 - [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 @@ -421,7 +368,6 @@ (i64-spec run) (f64-spec run) (text-spec run) - (array-spec run) (io-spec run) (box-spec run) )) -- cgit v1.2.3