diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-12-31 15:46:53 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-12-31 15:46:53 -0500 |
| commit | 156d54a73e005eecbb9a4284b74994313a34e4aa (patch) | |
| tree | b54f5574213df750d2b7292a088172f43b9f86a5 /test | |
| parent | 4b11f1b2b63effe71ddac5aac0879c1512057e8b (diff) | |
Add array:pop()
Diffstat (limited to 'test')
| -rw-r--r-- | test/arrays.tm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/arrays.tm b/test/arrays.tm index 8bc5a7f6..e32ee598 100644 --- a/test/arrays.tm +++ b/test/arrays.tm @@ -168,3 +168,19 @@ func main(): = none : Int? >> [4, 5, 6]:first(func(i:&Int): i:is_prime()) = 2 : Int? + + do: + >> nums := &[10, 20, 30, 40, 50] + >> nums:pop() + = 50 + >> nums + = &[10, 20, 30, 40] + >> nums:pop(2) + = 20 + >> nums + = &[10, 30, 40] + >> nums:clear() + >> nums + = &[] + >> nums:pop() + = none |
