Skip to content

Commit

Permalink
add two cases to ensure total coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Herringway committed Jul 19, 2018
1 parent d4b42f0 commit 61ebc9c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/consoul.d
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,14 @@ struct RGBA32 {
auto c2 = c1.randomComplementaryColour;
auto luminosityDifference = abs(c1.luminosity - c2.luminosity);
assert(luminosityDifference > 0.1, "Illegible random complementary colour generated - seed "~seed.text);

// Ensure both dark/light paths are covered
rndGen.seed = 2_927_724_004;
with (RGBA32.randomColour) {
randomComplementaryColour();
}
rndGen.seed = 4_288_425_729;
with (RGBA32.randomColour) {
randomComplementaryColour();
}
}

0 comments on commit 61ebc9c

Please sign in to comment.