Setting the PagedArray with an empty array hit the assert "Page index out of bounds"
alejandrogarin opened this issue · 5 comments
alejandrogarin commented
func testSetEmptyElementsFirstPage() {
var emptyArray: PagedArray<Int> = PagedArray(count: 0, pageSize: 10)
emptyArray.setElements(Array(), page: 0)
XCTAssertEqual(emptyArray.lastPage, 0)
}
func testSetEmptyElementsFirstPageWithStartPage() {
var emptyArray: PagedArray<Int> = PagedArray(count: 0, pageSize: 10, startPage:1)
emptyArray.setElements(Array(), page: 1)
XCTAssertEqual(emptyArray.lastPage, 1)
}
macfanatic commented
@alejandrogarin Did you easily find a work around for this?
alejandrogarin commented
I fixed the issue in my fork and added a couple of new features like reordering of elements. I don't think it was hard to fix.
macfanatic commented
Thanks, took a similar approach but nice improvements in your fork.
MrAlek commented
Sorry for being slow, buying a new apartment takes time! @alejandrogarin great job with your fork, you have some interesting changes which I'll look into.