The match_results constructor has the following postcondition: "Ensures: ready() returns false". The str() method of this class has the following precondition: "Requires: ready() == true". However, some tests call match_results.str() right after the constructor without checking the above precondition. This patch fixes this bug in tests.
Details
Details
Diff Detail
Diff Detail
- Repository
- rCXX libc++
Event Timeline
Comment Actions
Thanks for this patch; but I don't think the suggested changes are what we want.
Instead of:
assert(!m.ready() || m.str() == std::basic_string<CharT>());
I think we should just check:
assert(!m.ready());
because that's the post-condition for the constructor.
If you agree, I can just make the changes myself.