Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Add test case
  • Loading branch information
JukkaL committed Apr 23, 2026
commit 010729aeff52818d84734cd808041b421c500091
10 changes: 10 additions & 0 deletions mypyc/test-data/run-vecs-i64.test
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,16 @@ def test_cap_with_initializer() -> None:
assert v[0] == 1
assert v[1] == 2

def test_cap_from_range() -> None:
v = vec[i64](range(7), capacity=10)
old = v
v = append(v, 7)
v = append(v, 8)
v = append(v, 9)
v[0] = 99
assert old[0] == 99
assert v == vec[i64]([99, 1, 2, 3, 4, 5, 6, 7, 8, 9])

def test_cap_variable(n: i64 = 3) -> None:
v = vec[i64](capacity=n)
assert len(v) == 0
Expand Down
Loading