Include and forget testing framework for C++11
C++
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
amirite
test.cpp test: add tests for amisimilar Mar 20, 2013

README.md

amirite?

Simple unit testing library for C++11.

Assertions

You can directly call ami::fail, ami::pass or ami::success if you want, but the best way is to call the various helpers instead.

In these helpers there's an additional parameter which is additional information to be passed with the testcase result.

amitruthy (value)

Gets a value and checks it's truthy using if (value), which means if there's an operator bool it will be used.

amifalsy (value)

Gets a value and checks it's falsy using if (!value), which means if there's an operator ! it will be used.

amiequal (first, second)

Gets two values to compare using if (first == second), which means if there's an operator == it will be used.

amidifferent (first, second)

Gets two values to compare using if (first != second), which means if there's an operator != it will be used.

amisimilar (first, second, precision = -1)

Gets two floating point values to compare based on precision, if precision is -1 it will use the smallest std::numeric_limits<*type*>::digits10 value.

amithrown (type = std::exception, body)

Gets the type of the exception and a lambda, function or other std::function wrappable value and checks for the exception to be thrown, if nothing is thrown it fails.

amiokay (body)

Gets a lambda, function or ther std::function wrappable value and checks nothing is thrown, if something is it fails.