• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bemanproject / expected / 33698117589
96%

Build:
DEFAULT BRANCH: main
Ran 03 Sep 2026 12:12AM UTC
Jobs 1
Files 3
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Sep 2026 12:07AM UTC coverage: 95.522%. Remained the same
33698117589

push

github

web-flow
Scrap your static_assert: report compile-time checks instead of breaking the build (#89)

Removes every live `static_assert` from
`tests/beman/expected/*.test.cpp`, replacing each with a check the test
run *reports*.

### Why

A `static_assert` is a poor test. A wrong answer is a translation
failure, so the only thing anyone sees is a compiler diagnostic — the
test run reports nothing, the xUnit output is empty, and because the
build stops at the first failing assertion, no other test in the file is
exercised. A trait that flips from under you takes the whole file with
it and tells you about exactly one problem.

### What replaces it

Two header-only components under `tests/beman/expected/testing/`:

**`constant_eval(probe)`** is `consteval`, so calling it is an immediate
invocation: the probe is evaluated during translation and its result
must be a constant expression. *Whether* something can be
constant-evaluated is therefore still answered by the compiler, with no
`static_assert` needed — only the value comparison moves to the test
run:

```cpp
constexpr auto probe = [] {
    expt::expected<int, int> e(expt::unexpect, 7);
    return int_state{e.has_value(), e.error()};
};
CHECK(constant_eval(probe) == int_state{false, 7});   // constant evaluation
CHECK(probe() == int_state{false, 7});                // ordinary evaluation
```

A wrong value now reports `{ error 7 } == { error 3 }` and the rest of
the file still runs. Because the probe is a plain lambda rather than a
`consteval` one, the same body covers both evaluation modes — which
matters for a union-based type.

**`type_name<T>()`** returns the *identity* of `T`, compared with
`std::is_same_v`. The check is exactly as strict as the `static_assert`
it replaces; the compiler's spelling is consulted only to explain a
failure:

```
FAILED: CHECK( type_name<decltype(*e)>() == type_name<int&>() )
with expansion: const int& == int&
```

It has two implementations of that spelling, selected automatical... (continued)

704 of 737 relevant lines covered (95.52%)

25.09 hits per line

Jobs
ID Job ID Ran Files Coverage
1 33698117589.1 03 Sep 2026 12:12AM UTC 3
95.52
GitHub Action Run
Source Files on build 33698117589
  • Tree
  • List 3
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33698117589
  • e06fa0ef on github
  • Prev Build on main (#31327635033)
  • Next Build on main (#33709088651)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc