diff options
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r-- | stdlib/source/test/lux/data/binary.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/array.lux | 20 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/dictionary.lux | 16 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/list.lux | 22 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/queue.lux | 14 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/queue/priority.lux | 30 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/sequence.lux | 36 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/stack.lux | 16 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/text.lux | 4 |
9 files changed, 83 insertions, 83 deletions
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index d45cc6554..aab56834f 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -134,16 +134,16 @@ (case offset 0 (not verdict) _ verdict)))) - (_.cover [/.drop] - (and (\ /.equivalence = sample (/.drop 0 sample)) - (\ /.equivalence = (/.empty 0) (/.drop size sample)) + (_.cover [/.after] + (and (\ /.equivalence = sample (/.after 0 sample)) + (\ /.equivalence = (/.empty 0) (/.after size sample)) (case (list.reversed (..as_list sample)) #.End false (#.Item head tail) (n.= (list.fold n.+ 0 tail) - (/.fold n.+ 0 (/.drop 1 sample)))))) + (/.fold n.+ 0 (/.after 1 sample)))))) (_.cover [/.copy] (and (case (/.copy size 0 sample 0 (/.empty size)) (#try.Success output) diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux index c7433632e..c1e1471f8 100644 --- a/stdlib/source/test/lux/data/collection/array.lux +++ b/stdlib/source/test/lux/data/collection/array.lux @@ -66,7 +66,7 @@ (n.even? member)) the_array)] [(#.Some expected) (#.Some [idx actual])] - (case (/.read idx the_array) + (case (/.read! idx the_array) (#.Some again) (and (n.= expected actual) (n.= actual again)) @@ -114,12 +114,12 @@ _ false)) - (_.cover [/.read /.write!] + (_.cover [/.read! /.write!] (let [the_array (|> (/.empty 2) (: (Array Nat)) (/.write! 0 expected))] - (case [(/.read 0 the_array) - (/.read 1 the_array)] + (case [(/.read! 0 the_array) + (/.read! 1 the_array)] [(#.Some actual) #.None] (n.= expected actual) @@ -129,8 +129,8 @@ (let [the_array (|> (/.empty 1) (: (Array Nat)) (/.write! 0 expected))] - (case [(/.read 0 the_array) - (/.read 0 (/.delete! 0 the_array))] + (case [(/.read! 0 the_array) + (/.read! 0 (/.delete! 0 the_array))] [(#.Some actual) #.None] (n.= expected actual) @@ -148,7 +148,7 @@ (: (Array Nat)) (/.write! 0 base) (/.update! 0 (n.+ shift)))] - (case (/.read 0 the_array) + (case (/.read! 0 the_array) (#.Some actual) (n.= expected actual) @@ -160,8 +160,8 @@ (/.write! 0 base) (/.upsert! 0 dummy (n.+ shift)) (/.upsert! 1 base (n.+ shift)))] - (case [(/.read 0 the_array) - (/.read 1 the_array)] + (case [(/.read! 0 the_array) + (/.read! 1 the_array)] [(#.Some actual/0) (#.Some actual/1)] (and (n.= expected actual/0) (n.= expected actual/1)) @@ -195,7 +195,7 @@ (/.empty size))] (exec (/.copy! amount 0 the_array 0 copy) (\ (list.equivalence n.equivalence) = - (list.take amount (/.list the_array)) + (list.first amount (/.list the_array)) (/.list copy)))))) (_.cover [/.clone] (let [clone (/.clone the_array)] diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux index 7114a2eed..82e421d28 100644 --- a/stdlib/source/test/lux/data/collection/dictionary.lux +++ b/stdlib/source/test/lux/data/collection/dictionary.lux @@ -161,9 +161,9 @@ (#.Some v) (n.= test_val v) _ true))) - (_.cover [/.try_put /.key_already_exists] + (_.cover [/.has' /.key_already_exists] (let [can_put_new_keys! - (case (/.try_put non_key test_val dict) + (case (/.has' non_key test_val dict) (#try.Success dict) (case (/.value non_key dict) (#.Some v) (n.= test_val v) @@ -175,7 +175,7 @@ cannot_put_old_keys! (or (n.= 0 size) (let [first_key (|> dict /.keys list.head maybe.assume)] - (case (/.try_put first_key test_val dict) + (case (/.has' first_key test_val dict) (#try.Success _) false @@ -206,9 +206,9 @@ _ false))) - (_.cover [/.upsert] + (_.cover [/.revised'] (let [can_upsert_new_key! - (case (/.value non_key (/.upsert non_key test_val inc dict)) + (case (/.value non_key (/.revised' non_key test_val inc dict)) (#.Some inserted) (n.= (inc test_val) inserted) @@ -221,7 +221,7 @@ true (#.Some [known_key known_value]) - (case (/.value known_key (/.upsert known_key test_val inc dict)) + (case (/.value known_key (/.revised' known_key test_val inc dict)) (#.Some updated) (n.= (inc known_value) updated) @@ -237,10 +237,10 @@ /.size (n.= 1))) - (_.cover [/.re_bind] + (_.cover [/.re_bound] (or (n.= 0 size) (let [first_key (|> dict /.keys list.head maybe.assume) - rebound (/.re_bind first_key non_key dict)] + rebound (/.re_bound first_key non_key dict)] (and (n.= (/.size dict) (/.size rebound)) (/.key? rebound non_key) (not (/.key? rebound first_key)) diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index 7fb1e8704..ce86a80c7 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -202,18 +202,18 @@ positives) (/\= (/.only (bit.complement n.even?) sample) negatives)))) - (_.cover [/.split] - (let [[left right] (/.split idx sample)] + (_.cover [/.split_at] + (let [[left right] (/.split_at idx sample)] (/\= sample (/\compose left right)))) (_.cover [/.split_when] (let [[left right] (/.split_when n.even? sample)] (/\= sample (/\compose left right)))) - (_.cover [/.take /.drop] + (_.cover [/.first /.after] (/\= sample - (/\compose (/.take idx sample) - (/.drop idx sample)))) + (/\compose (/.first idx sample) + (/.after idx sample)))) (_.cover [/.while /.until] (/\= sample (/\compose (/.while n.even? sample) @@ -292,9 +292,9 @@ (n.min (/.size sample/0) (/.size sample/1))) can_extract_values! - (and (/\= (/.take zipped::size sample/0) + (and (/\= (/.first zipped::size sample/0) (/\map product.left zipped)) - (/\= (/.take zipped::size sample/1) + (/\= (/.first zipped::size sample/1) (/\map product.right zipped)))] (and size_of_smaller_list! can_extract_values!))) @@ -310,11 +310,11 @@ (/.size sample/2))) can_extract_values! - (and (/\= (/.take zipped::size sample/0) + (and (/\= (/.first zipped::size sample/0) (/\map product.left zipped)) - (/\= (/.take zipped::size sample/1) + (/\= (/.first zipped::size sample/1) (/\map (|>> product.right product.left) zipped)) - (/\= (/.take zipped::size sample/2) + (/\= (/.first zipped::size sample/2) (/\map (|>> product.right product.right) zipped)))] (and size_of_smaller_list! can_extract_values!))) @@ -424,7 +424,7 @@ 0))))) (_.cover [/.folds] (/\= (/\map (function (_ index) - (\ /.fold fold n.+ 0 (/.take index sample))) + (\ /.fold fold n.+ 0 (/.first index sample))) (/.indices (inc (/.size sample)))) (/.folds n.+ 0 sample))) (do random.monad diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux index 33ec7d9ba..5fcec5102 100644 --- a/stdlib/source/test/lux/data/collection/queue.lux +++ b/stdlib/source/test/lux/data/collection/queue.lux @@ -58,8 +58,8 @@ /.empty))] (and empty_is_empty! all_empty_queues_look_the_same!))) - (_.cover [/.peek] - (case [members (/.peek sample)] + (_.cover [/.front] + (case [members (/.front sample)] [(#.Item head tail) (#.Some first)] (n.= head first) @@ -77,8 +77,8 @@ (not (/.member? n.equivalence sample non_member))] (and every_member_is_identified! non_member_is_not_identified!))) - (_.cover [/.push] - (let [pushed (/.push non_member sample) + (_.cover [/.end] + (let [pushed (/.end non_member sample) size_increases! (n.= (inc (/.size sample)) (/.size pushed)) @@ -93,10 +93,10 @@ (and size_increases! new_member_is_identified! has_expected_order!))) - (_.cover [/.pop] + (_.cover [/.next] (case members (#.Item target expected) - (let [popped (/.pop sample) + (let [popped (/.next sample) size_decreases! (n.= (dec (/.size sample)) @@ -115,5 +115,5 @@ #.End (and (/.empty? sample) - (/.empty? (/.pop sample))))) + (/.empty? (/.next sample))))) )))) diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux index 20579c5b6..4faaaf488 100644 --- a/stdlib/source/test/lux/data/collection/queue/priority.lux +++ b/stdlib/source/test/lux/data/collection/queue/priority.lux @@ -22,7 +22,7 @@ (monad.fold ! (function (_ head tail) (do ! [priority random.nat] - (in (/.push priority head tail)))) + (in (/.end priority head tail)))) /.empty inputs))) @@ -47,28 +47,28 @@ (/.empty? sample))) (_.cover [/.empty] (/.empty? /.empty)) - (_.cover [/.peek] - (case (/.peek sample) + (_.cover [/.front] + (case (/.front sample) (#.Some first) (n.> 0 (/.size sample)) #.None (/.empty? sample))) (_.cover [/.member?] - (case (/.peek sample) + (case (/.front sample) (#.Some first) (/.member? n.equivalence sample first) #.None (/.empty? sample))) - (_.cover [/.push] - (let [sample+ (/.push non_member_priority non_member sample)] + (_.cover [/.end] + (let [sample+ (/.end non_member_priority non_member sample)] (and (not (/.member? n.equivalence sample non_member)) (n.= (inc (/.size sample)) (/.size sample+)) (/.member? n.equivalence sample+ non_member)))) - (_.cover [/.pop] - (let [sample- (/.pop sample)] + (_.cover [/.next] + (let [sample- (/.next sample)] (or (and (/.empty? sample) (/.empty? sample-)) (n.= (dec (/.size sample)) @@ -77,17 +77,17 @@ ($_ _.and (_.cover [/.max] (|> /.empty - (/.push /.min min_member) - (/.push /.max max_member) - /.peek + (/.end /.min min_member) + (/.end /.max max_member) + /.front (maybe\map (n.= max_member)) (maybe.else false))) (_.cover [/.min] (|> /.empty - (/.push /.max max_member) - (/.push /.min min_member) - /.pop - /.peek + (/.end /.max max_member) + (/.end /.min min_member) + /.next + /.front (maybe\map (n.= min_member)) (maybe.else false))) )) diff --git a/stdlib/source/test/lux/data/collection/sequence.lux b/stdlib/source/test/lux/data/collection/sequence.lux index 9a2c78afb..19183f1b1 100644 --- a/stdlib/source/test/lux/data/collection/sequence.lux +++ b/stdlib/source/test/lux/data/collection/sequence.lux @@ -26,8 +26,8 @@ (def: (= reference subject) (\ (list.equivalence super) = - (/.take 100 reference) - (/.take 100 subject)))) + (/.first 100 reference) + (/.first 100 subject)))) (def: .public test Test @@ -53,18 +53,18 @@ (_.cover [/.repeated] (n.= repeated (/.item index (/.repeated repeated)))) - (_.cover [/.take] + (_.cover [/.first] (list\= (enum.range n.enum offset (dec (n.+ size offset))) - (/.take size (/.iterations inc offset)))) - (_.cover [/.drop] + (/.first size (/.iterations inc offset)))) + (_.cover [/.after] (list\= (enum.range n.enum offset (dec (n.+ size offset))) - (/.take size (/.drop offset (/.iterations inc 0))))) - (_.cover [/.split] - (let [[drops takes] (/.split size (/.iterations inc 0))] + (/.first size (/.after offset (/.iterations inc 0))))) + (_.cover [/.split_at] + (let [[drops takes] (/.split_at size (/.iterations inc 0))] (and (list\= (enum.range n.enum 0 (dec size)) drops) (list\= (enum.range n.enum size (dec (n.* 2 size))) - (/.take size takes))))) + (/.first size takes))))) (_.cover [/.while] (list\= (enum.range n.enum 0 (dec size)) (/.while (n.< size) (/.iterations inc 0)))) @@ -83,10 +83,10 @@ (/.head (/.iterations inc offset)))) (_.cover [/.tail] (list\= (enum.range n.enum (inc offset) (n.+ size offset)) - (/.take size (/.tail (/.iterations inc offset))))) + (/.first size (/.tail (/.iterations inc offset))))) (_.cover [/.only] (list\= (list\map (n.* 2) (enum.range n.enum 0 (dec size))) - (/.take size (/.only n.even? (/.iterations inc 0))))) + (/.first size (/.only n.even? (/.iterations inc 0))))) (_.cover [/.partition] (let [[evens odds] (/.partition n.even? (/.iterations inc 0))] (and (n.= (n.* 2 offset) @@ -96,16 +96,16 @@ (_.cover [/.unfold] (let [(^open "/\.") /.functor (^open "list\.") (list.equivalence text.equivalence)] - (list\= (/.take size - (/\map %.nat (/.iterations inc offset))) - (/.take size - (/.unfold (function (_ n) [(inc n) (%.nat n)]) - offset))))) + (list\= (/.first size + (/\map %.nat (/.iterations inc offset))) + (/.first size + (/.unfold (function (_ n) [(inc n) (%.nat n)]) + offset))))) (_.cover [/.cycle] (let [cycle (list& cycle_start cycle_next)] (list\= (list.joined (list.repeated size cycle)) - (/.take (n.* size (list.size cycle)) - (/.cycle [cycle_start cycle_next]))))) + (/.first (n.* size (list.size cycle)) + (/.cycle [cycle_start cycle_next]))))) (_.cover [/.^sequence&] (let [(/.^sequence& first second third next) (/.iterations inc offset)] (and (n.= offset first) diff --git a/stdlib/source/test/lux/data/collection/stack.lux b/stdlib/source/test/lux/data/collection/stack.lux index 591308f56..79355156f 100644 --- a/stdlib/source/test/lux/data/collection/stack.lux +++ b/stdlib/source/test/lux/data/collection/stack.lux @@ -20,7 +20,7 @@ (def: (injection value) (Injection /.Stack) - (/.push value /.empty)) + (/.top value /.empty)) (def: .public test Test @@ -43,24 +43,24 @@ (/.empty? sample))) (_.cover [/.empty] (/.empty? /.empty)) - (_.cover [/.peek] - (case (/.peek sample) + (_.cover [/.value] + (case (/.value sample) #.None (/.empty? sample) (#.Some _) (not (/.empty? sample)))) - (_.cover [/.pop] - (case (/.pop sample) + (_.cover [/.next] + (case (/.next sample) #.None (/.empty? sample) (#.Some [top remaining]) (\ (/.equivalence n.equivalence) = sample - (/.push top remaining)))) - (_.cover [/.push] - (case (/.pop (/.push expected_top sample)) + (/.top top remaining)))) + (_.cover [/.top] + (case (/.next (/.top expected_top sample)) (#.Some [actual_top actual_sample]) (and (same? expected_top actual_top) (same? sample actual_sample)) diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index f95757333..1efa4ebfe 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -288,8 +288,8 @@ .let [sample (/.joined (list sampleL sampleR)) (^open "/\.") /.equivalence]] ($_ _.and - (_.cover [/.split] - (|> (/.split sizeL sample) + (_.cover [/.split_at] + (|> (/.split_at sizeL sample) (case> (#.Right [_l _r]) (and (/\= sampleL _l) (/\= sampleR _r) |