test: peek tests done

This commit is contained in:
2026-04-23 09:39:59 -06:00
parent 4a1575e833
commit 9920b518bf
2 changed files with 84 additions and 2 deletions

View File

@@ -528,7 +528,7 @@ ArrayListErr arrayslice_peek(const ArraySlice *slice, void *out) {
return ARRLIST_NULL_ARG;
}
if (slice->current == slice->end) {
if (slice->current >= slice->end) {
return ARRLIST_INVALID_SLICE;
}
@@ -569,7 +569,7 @@ ArrayListErr arrayslice_advance(ArraySlice *slice, size_t n) {
return ARRLIST_NULL_ARG;
}
if (n > SIZE_MAX - slice->current || slice->current + n >= slice->end) {
if (n > SIZE_MAX - slice->current || slice->current + n > slice->end) {
return ARRLIST_OUT_OF_BOUNDS;
}