SHTK_UNITTEST_ADD_TEST(3)

πŸ“¦ version 1.7, in nixos 26.05, nixpkgs unstable

okay bestie, welcome to shtk_unittest_add_test(3) β€” it lives in the Library Functions Manual and it's a tiny little helper with main-character energy πŸŽ€

πŸ’– NAME πŸ’–

shtk_unittest_add_test β€” Defines a standalone test case ✨

πŸ“š LIBRARY πŸ“š

shtk_import unittest

πŸ¦‹ SYNOPSIS πŸ¦‹

shtk_unittest_add_test name

πŸŽ€ DESCRIPTION πŸŽ€

The shtk_unittest_add_test function registers the standalone test case given by name. That's the whole vibe.

But here's the part you cannot skip, bestie: a function named <name>_test must be defined after the call to shtk_unittest_add_test has been made. Order matters, fr fr.

no cap: define <name>_test after you've already called shtk_unittest_add_test. that's the rule πŸ’…

πŸ§ͺ EXAMPLES πŸ§ͺ

The following piece of code illustrates the definition of a couple of test cases:

             shtk_unittest_add_test first_scenario
             first_scenario_test() {
                 ... test code for the first test case ...
             }

             shtk_unittest_add_test second_scenario
             second_scenario_test() {
                 ... test code for the second test case ...
             }

πŸ‘€ SEE ALSO πŸ‘€

🌸 HISTORY 🌸

shtk_unittest_add_test first appeared in shtk 1.6.


and that's the cute little sign-off: this page is the Debian one, dated November 8, 2014, and it's literally SHTK_UNITTEST_ADD_TEST(3) β€” mwah πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from