Fuzz input validators for trailing whitespace#347
Conversation
|
On another note, as far as I can tell, we use |
I'm not sure fixing a seed at the start of execution is great, as adding a new junk case (or any other use of random) can then change all values. I would prefer that for the cases where we want to fix a seed (probably all of them), we do For a couple of the cases, where we're adding whitespace, I also feel we could simply skip randomness. If we want the input validator to catch trailing whitespace, why are we adding 1-5 spaces, instead of always adding the smallest amount we want it to catch (1)? I would be surprised if there are common bugs where you properly forbid 1 trailing space, but catch 2... |
|
While I added a comment about how we do random, I think this is a very good addition by itself, so I'll merge it now, and then we can do a separate PR if we want to adjust randomness per my comment above (explicit seeding in a few places, and just adding a single space/newline in a couple of cases). |
At the time of writing, 16 Aug 2025, both https://open.kattis.com/problems/procrastination and https://open.kattis.com/problems/ekkiminnforseti have trailing whitespaces in their samples. This is very minor, but should IMO not happen.
This PR adds tests that check the input validator will reject this.