<commit_before>#pragma once

#include <rapidcheck.h>

namespace rc {

//! For use with `catch.hpp`. Use this function wherever you would use a
//! `SECTION` for convenient checking of properties.
//!
//! @param description  A description of the property.
//! @param testable     The object that implements the property.
template<typename Testable>
void prop(const std::string &description, const Testable &testable)
{
    using namespace detail;

    SECTION(description) {
        auto result = checkTestable(testable);
        INFO(resultMessage(result) << "\n");

        FailureResult failure;
        GaveUpResult gaveUp;
        if (result.match(failure)) {
            std::string counterExample;
            for (const auto &desc : failure.counterExample) {
                counterExample += desc.first + ":\n";
                counterExample += desc.second + "\n\n";
            }
            INFO(counterExample);
            FAIL("Property failed: " << failure.description);
        } else if (result.match(gaveUp)) {
            INFO(gaveUp.description);
            FAIL("Gave up after " << gaveUp.numSuccess << " successful tests");
        }
    }
}

} // namespace rc<commit_msg>Don't print "Property failed:" in rapidcheck-catch<commit_after>#pragma once

#include <rapidcheck.h>

namespace rc {

//! For use with `catch.hpp`. Use this function wherever you would use a
//! `SECTION` for convenient checking of properties.
//!
//! @param description  A description of the property.
//! @param testable     The object that implements the property.
template<typename Testable>
void prop(const std::string &description, const Testable &testable)
{
    using namespace detail;

    SECTION(description) {
        auto result = checkTestable(testable);
        INFO(resultMessage(result) << "\n");

        FailureResult failure;
        GaveUpResult gaveUp;
        if (result.match(failure)) {
            std::string counterExample;
            for (const auto &desc : failure.counterExample) {
                counterExample += desc.first + ":\n";
                counterExample += desc.second + "\n\n";
            }
            INFO(counterExample);
            FAIL(failure.description);
        } else if (result.match(gaveUp)) {
            INFO(gaveUp.description);
            FAIL("Gave up after " << gaveUp.numSuccess << " successful tests");
        }
    }
}

} // namespace rc
{'fraction_non_alphanumeric': 0.11647254575707154, 'fraction_numerical': 0.0, 'mean_word_length': 2.4505021520803445, 'pattern_counts': {'":': 2, '<': 21, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '784044', 'n_tokens_mistral': 652, 'n_tokens_neox': 626, 'n_words': 186}