operators(9)
π operators
ok so this is from the Kernel API Manual bestie β the operators(9) page β and it's literally the cheat sheet for the operator macros you drop inside TEST and TEST_F. β¨
Here's the whole vibe, and it's genuinely this simple:
ASSERT_*calls β these ones do NOT play. The second one trips, test execution stops immediately, right there, no coming back. πEXPECT_*calls β way more chill. They emit a failure warning, they note it, and then they continue on with the test like nothing happened. π«Ά
That's it, that's the whole page. No cap. The difference between the two families is literally just "stop the whole thing" vs "log it and keep going," and honestly that's the tea. π
bestie pls remember: withASSERT_*you don't get to see what would've happened after β it's over. WithEXPECT_*you get the full picture but you gotta actually read your warnings. π
π SEE ALSO β¨
The main character of this whole saga is the kernel file ./tools/testing/selftests/kselftest_harness.h β go read example(9) first, it's giving tutorial energy π§. Then the whole friend group:
TH_LOG(9)SKIP(9)TEST(9)TEST_SIGNAL(9)FIXTURE_DATA(9)FIXTURE(9)FIXTURE_SETUP(9)FIXTURE_TEARDOWN(9)FIXTURE_TEARDOWN_PARENT(9)FIXTURE_VARIANT(9)FIXTURE_VARIANT_ADD(9)TEST_F(9)TEST_HARNESS_MAIN(9)
The assert girlies π₯:
ASSERT_EQ(9)ASSERT_NE(9)ASSERT_LT(9)ASSERT_LE(9)ASSERT_GT(9)ASSERT_GE(9)ASSERT_NULL(9)ASSERT_TRUE(9)ASSERT_FALSE(9)ASSERT_STREQ(9)ASSERT_STRNE(9)
The expect girlies πΈ:
EXPECT_EQ(9)EXPECT_NE(9)EXPECT_LT(9)EXPECT_LE(9)EXPECT_GT(9)EXPECT_GE(9)EXPECT_NULL(9)EXPECT_TRUE(9)EXPECT_FALSE(9)EXPECT_STREQ(9)EXPECT_STRNE(9)
And the one who's like "I told you so" π:
okay that's the page!! it lives down in ./tools/testing/selftests and it's dated October 2026, stamped with operators(9) at the bottom like a little signature π go forth and test, bestie β you're gonna slay π¦β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms