aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/arrays.tm11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/arrays.tm b/test/arrays.tm
index ac243018..c693996e 100644
--- a/test/arrays.tm
+++ b/test/arrays.tm
@@ -158,3 +158,14 @@ func main():
>> nums:sort(func(a,b:&%Int): a:abs() <> b:abs())
>> [nums:binary_search(i, func(a,b:&Int): a:abs() <> b:abs()) for i in nums]
= [1, 2, 3, 4, 5]
+
+ >> [10, 20, 30]:find(20)
+ = 2
+ >> [10, 20, 30]:find(999)
+ = 0
+
+ >> [10, 20]:first(func(i:&Int): i:is_prime())
+ = !Int
+ >> [4, 5, 6]:first(func(i:&Int): i:is_prime())
+ = @%5?
+