Skip to content

unexpected output #694

@parihaaraka

Description

@parihaaraka

Slightly adjusted example from the README.md:

using namespace boost; // nothrow is ambiguous
using namespace boost::ut;

constexpr auto sum(auto... values) { return (values + ...); }

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

  "sum"_test = [] {
    expect(2 == 0_i) << "message";
    expect(sum(2, 2) == 3_i);
    expect(sum(1, 2) > 0_i and 41_i == sum(40, 2));
  };
}

produces:

Running test "sum"... FAILED
in: /tests/main.cpp:13 - test condition:  [2 == 0]

 message
Running test "sum"... FAILED
in: /tests/main.cpp:13 - test condition:  [2 == 0] messageFAILED
in: /tests/main.cpp:14 - test condition:  [4 == 3]


Running test "sum"... FAILED
in: /tests/main.cpp:13 - test condition:  [2 == 0] messageFAILED
in: /tests/main.cpp:14 - test condition:  [4 == 3]FAILED
in: /tests/main.cpp:15 - test condition:  [(3 > 0 and 41 == 42)]


===============================================================================
Suite global
tests:   1 | 3 failed
asserts: 3 | 0 passed | 3 failed


Terminal process exited with code 255.

Why is everything like this?! 🤯

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions