Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1166

Catch comparison expressions with bsoncxx::document::view operands should pretty-print when test fails

    XMLWordPrintableJSON

Details

    Description

      For document::view variables "a" and "b", a failure of the Catch test statement "REQUIRE(a == b)" results in the following output:

      1: /Users/rassi/work/mongo-cxx-driver/src/bsoncxx/test/bson_builder.cpp:938: FAILED:
      1:   REQUIRE( a == b )
      1: with expansion:
      1:   {?} == {?}
      

      Instead of printing a question mark for "a" and "b", their JSON representations should be printed instead.

      This may be as simple as providing a "operator<<(std::ostream&, document::view)" overload in the right place which streams the result of to_json().

      Attachments

        Activity

          People

            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: