fdo#74041: Write unit test for this.

Change-Id: I3af0e5be3f7c6ae15ebd26335020c8beb96d14d2