fdo#71076: Write test for this.

This was actually just one element of all that contributed to this bug.
Unfortunately it's a bit hard to test the others.

Change-Id: I7a0d88c0b829e7b7859aecfc20df87f6837ecb4a