Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of asserts is reported wrongly #624

Open
SimonMarynissen opened this issue Apr 25, 2024 · 0 comments
Open

Number of asserts is reported wrongly #624

SimonMarynissen opened this issue Apr 25, 2024 · 0 comments

Comments

@SimonMarynissen
Copy link

For the following very simple code:

#include <boost/ut.hpp>
#include <vector>

int main() {
  using namespace boost::ut;

  "args"_test = [](const auto& arg) {
    expect(arg > 0_i) << "all values greater than 0";
  } | std::vector{1, 2, 3};
}

Expected Behavior

It outputs Suite 'global': all tests passed (6 asserts in 3 tests)

Actual Behavior

It should output Suite 'global': all tests passed (3 asserts in 3 tests)

It is not always just double the number of asserts. For example on my own code I got Suite 'global': all tests passed (1806 asserts in 84 tests), while each test has a single expect.

Steps to Reproduce the Problem

Check out on compiler explorer.

Specifications

  • Version: latest (2.0.1)
  • Platform: I tested both on msvc and gcc (I suspect clang too)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant