Skip to content

Commit

Permalink
test: improve coverage for builtin/fixedarray.mbt
Browse files Browse the repository at this point in the history
**Disclaimer:** This PR was generated by an LLM agent as part of an experiment.

## Summary

```
coverage of `builtin/fixedarray.mbt`: 73.3% -> 80.0%
```
  • Loading branch information
rami3l committed Jan 24, 2025
1 parent 5b7fef5 commit aa239b5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions builtin/fixedarray_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,18 @@ test "is_empty" {
let arr : FixedArray[Int] = []
assert_true!(arr.is_empty())
}

test "fixed array iter with early termination" {
let arr : FixedArray[Int] = [1, 2, 3]
let mut count = 0
let iter = arr.iter()
let _ = iter.run(fn(x) {
count = count + 1
if x == 2 {
IterEnd
} else {
IterContinue
}
})
inspect!(count, content="2")
}

0 comments on commit aa239b5

Please sign in to comment.