test_util for matching exceptions should produce clearer explanation

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Trivial - P5
    • 3.7.0
    • Affects Version/s: None
    • Component/s: Testing
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Our current Catch2 helper for matching against an expected exception message produces this output on failure:

      with expansion:
      Failed to resolve doesnotexist.invalid: generic server error mongocxx::
      exception contains message: "parse error"

      While certainly useful, it is misleading: the exception does NOT contain the message "parse error". Instead, that is the message it was /expected/ to contain:

      std::string describe() const override

      { return std::string("mongocxx::exception contains message: \"") + expected_msg + "\""; }

      If the reader of the test message trusts the explanation, this can cause some real head-scratching.

      This should be corrected so that the intent and output match, something like:

      exception was expected to contain: "parse error"

              Assignee:
              Jesse Williamson (Inactive)
              Reporter:
              Jesse Williamson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: