Make Unit Tests That Could Never Fail Check Real Behavior

Rework tests whose assertions held whatever the production code did: inverted or self-referential checks, checks on values the test had just set, branches that never ran, symmetric fixtures that hid the behavior under test, font paths that skipped silently, and Voronoi reproducers that only exercised boost. Each now asserts the behavior its name describes.
This commit is contained in:
Hanif Koh authored and HanifKoh committed 2026-10-20 14:11:26 +08:00
1 parent 6626377abc
commit 42bd103958
18 files changed
+486 -285

No files matched your search

@@ -76,12 +76,12 @@ TEST_CASE("plugin latest version uses the authoritative catalog field", "[Plugin
{
PluginDescriptor descriptor;
descriptor.version = "1.3.0";
descriptor.latest_version = "1.3.0";
descriptor.latest_version = "1.4.0";
PluginChangelog changelog;
changelog.version = "1.2.0";
descriptor.changelog.push_back(changelog);
CHECK(descriptor.latest_available_version() == "1.3.0");
CHECK(descriptor.latest_available_version() == "1.4.0");
}
TEST_CASE("plugin latest version falls back to the descriptor version", "[PluginDescriptor]")