mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
std/lib/collections: make List support the []= operator (#831)
* std/lib/collections: make List support the []= operator Signed-off-by: Pierre Curto <pierre.curto@gmail.com> * std/lib/io: rename receiver to self Signed-off-by: Pierre Curto <pierre.curto@gmail.com> --------- Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -16,7 +16,9 @@ fn void! test_delete_contains_index()
|
||||
test.push(3);
|
||||
assert(test.array_view() == int[]{ 1, 2, 3 });
|
||||
assert(test.contains(3));
|
||||
test.remove(1);
|
||||
test[0] = 10;
|
||||
assert(test.contains(10));
|
||||
test.remove(10);
|
||||
assert(test.array_view() == int[]{ 2, 3 });
|
||||
assert(!test.contains(1));
|
||||
assert(test.contains(2));
|
||||
|
||||
Reference in New Issue
Block a user