fix test so that it can be ran multiple times instead of just once

This is the only test in the whole suite that cannot be ran multiple times, because undef will fail the second time.
It is nice to be able to do this e.g. for benchmarking reasons.