Better custom matcher

Open
#3,049 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
testing

Research direction

The issue names no files, tests, or entry points. Start by reviewing Catch2's existing old- and new-style custom matcher APIs, then determine the proposed stringification mechanism and its failure-message behavior. Done should mean equality checks for custom objects can produce friendly diagnostics with substantially less matcher code.

Written by the indexing model from the issue text.

Description

The old and new style custom matchers both need bunch of code.

In the most situation, I need only test equality of two custom objects. It is convenient to use standard operator==, but no friendly message when test fails.

So I think it will be good to define some kind of to_string function of custom object, thus it will need no much code to satisfy my needs.

Dominant language
C++
Stars
21.6k
Forks
3.4k
Avg merge
3d 12h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from catchorg/Catch2

All issues in catchorg/Catch2

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.