[libcxx-commits] [libcxx] [libc++][NFC] Make AssertionInfoMatcher::CheckMessageMatches Stricter (PR #77721)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jan 10 19:41:34 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Will Hawkins (hawkinsw)
<details>
<summary>Changes</summary>
Rather than allow for a message to be considered a match for the actual assertion if it is anywhere in the assertion text, make sure that the expected and the actual assertion are identical.
Addresses #<!-- -->77701
---
Full diff: https://github.com/llvm/llvm-project/pull/77721.diff
1 Files Affected:
- (modified) libcxx/test/support/check_assertion.h (+1-2)
``````````diff
diff --git a/libcxx/test/support/check_assertion.h b/libcxx/test/support/check_assertion.h
index 98dd95b11556e6..01e296d9138d0c 100644
--- a/libcxx/test/support/check_assertion.h
+++ b/libcxx/test/support/check_assertion.h
@@ -89,8 +89,7 @@ struct AssertionInfoMatcher {
std::size_t found_at = got_msg.find(msg_);
if (found_at == std::string_view::npos)
return false;
- // Allow any match
- return true;
+ return found_at == 0 && got_msg.size() == msg_.size();
}
private:
bool is_empty_;
``````````
</details>
https://github.com/llvm/llvm-project/pull/77721
More information about the libcxx-commits
mailing list