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

Function main

example/mut.cpp:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <boost/ut.hpp>
9
10int main() {
11 using namespace boost::ut;
12
13 auto i = 0; // mutable
14
15 "mut"_test = [i] {
16 expect((i == 0_i) >> fatal); // immutable
17
18 should("++") = [i] {
19 expect(++mut(i) == 1_i); // mutable
20 expect(i == 1_i); // immutable
21 };
22
23 should("--") = [i] {
24 expect(--mut(i) == -1_i); // mutable
25 expect(i == -1_i); // immutable
26 };
27 };
28}

Callers

nothing calls this directly

Calls 2

expectFunction · 0.85
mutFunction · 0.85

Tested by

no test coverage detected