Add test for #10288

This happened because of the vector with_capacity overflow that was fixed
in #10417.

Fixes #10288