You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional context
My specific use-case in which I ran into this is a test like this:
TEST_CASE("my function") {
auto size = GENERATE(0, 1, 2, 3);
auto vector = GENERATE_COPY(take(1, chunk(size, random(-100, 100))));
auto list = VectorToList(vector);
REQUIRE(list.size() == size);
}
It's possible that the intended behaviour was to return a minimum chunk-size of 1 for all chunks, but I think it would make much more sense to return empty vectors, otherwise the use-case above would be more annoying to write.
The text was updated successfully, but these errors were encountered:
I am honestly surprised that I didn't make the ChunkGenerator assert on chunk_size == 0.
Anyway, I will have to think about it for a bit -- I am not sure what I think about making the generator potentially infinite even when given a finite generator as an input.
Describe the bug
When using
ChunkGenerator
with a chunk-size of 0, the first vector returned is size 1. Following vectors are size 0.Expected behavior
The first (and all following) vectors should be size 0.
Reproduction steps
Platform information:
Additional context
My specific use-case in which I ran into this is a test like this:
It's possible that the intended behaviour was to return a minimum chunk-size of 1 for all chunks, but I think it would make much more sense to return empty vectors, otherwise the use-case above would be more annoying to write.
The text was updated successfully, but these errors were encountered: