MCPcopy Create free account
hub / github.com/boost-ext/ut / main

Function main

example/attr.cpp:12–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10constexpr auto sum = [](auto... args) { return (0 + ... + args); };
11
12int main() {
13 using boost::ut::operator""_test;
14 using namespace boost::ut::literals;
15 using namespace boost::ut::operators::terse;
16
17 "macro"_test = [] {
18#define expect void(),
19 expect sum(1, 1) == 2_i;
20 expect(6_i == sum(1, 2, 3));
21#undef expect
22 };
23
24#if __has_cpp_attribute(expect)
25 "attribute"_test = [] {
26 [[expect]] 3_i == sum(1, 2);
27 [[expect]] (sum(1, 2) == 3_i);
28 };
29#endif
30}

Callers

nothing calls this directly

Calls 1

expectFunction · 0.85

Tested by

no test coverage detected