~ lemon ~
lemon is a tiny, fast unit-testing framework designed to take almost no time
to set up.
~ philosophy ~
lemon is designed to be small, really small. That way you can worry less
about setting up the framework and more about writing tests.
~ installation ~
Just add lemon.h to your project or place it in a common directory for your
compiler (On Linux/Mac/Unix this might be /usr/local/include).
~ a not-so-bitter taste of lemon ~
To start writing tests in lemon:
- initialize lemon
lemon::test<> lemon(num_tests_which_you_plan_to_run);
- conduct tests
lemon.is(this_one_equal_to, that_one, descriptive_test_name);
- display results
lemon.done();
~ assertions ~
lemon provides a minimal but complete set of assertions:
-
ok(boolean_condition, descriptive_test_name)
-
not_ok(boolean_condition, descriptive_test_name)
-
is(this_one, that_one, descriptive_test_name)
-
isnt(this_one, that_one, descriptive_test_name)
-
pass(descriptive_test_name)
-
fail(descriptive_test_name)
-
skip(reason, num_to_skip)
-
todo(what)