20 lines
443 B
C++
20 lines
443 B
C++
#include "test/u.hpp"
|
|
#include <chrono>
|
|
#include <thread>
|
|
|
|
namespace {
|
|
|
|
AddTestCase _(0, "tester", [](TestCase& t) {
|
|
t.expectTrue([] { return true; });
|
|
t.expectFalse([] { return false; });
|
|
t.expectTrue([] {
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
|
return true;
|
|
});
|
|
|
|
t.expectEq<int>([] { return 42; }, 42);
|
|
t.expectEq<float>([] { return 10 + 1e-7; }, 10);
|
|
t.expectEq<double>([] { return 10 + 1e-10; }, 10);
|
|
});
|
|
}
|