catchorg / catchorg/Catch2

THROWS_WITH assertions false negative result in one case

Open
#1,818 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Describe the bug**
Just run:
```
CHECK_THROWS_WITH(throw 5, "Unknown exception");
```
...and it doesn't fail

**Expected behavior**
The test should fail with a message:
```
CHECK_THROWS_WITH( throw 5, "Unknown exception" )
with expansion:
no message equals: "Unknown exception"
```

**Reproduction steps**
```
CHECK_THROWS_WITH(throw 5, "Unknown exception");
```

**Platform information:**

- OS: **Linux**
- Compiler+version: **GCC v9.1.0**
- Catch version: **v2.11.0**

**Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.