validate diff and assert that it formats as expected, both directly and through Array::Equals
| 94 | // validate diff and assert that it formats as expected, both directly |
| 95 | // and through Array::Equals |
| 96 | void AssertDiffAndFormat(const std::string& formatted_expected) { |
| 97 | std::stringstream formatted; |
| 98 | |
| 99 | DoDiffAndFormat(&formatted); |
| 100 | ASSERT_EQ(formatted.str(), formatted_expected) << "formatted diff incorrectly"; |
| 101 | formatted.str(""); |
| 102 | |
| 103 | ASSERT_EQ(edits_->length() == 1, |
| 104 | base_->Equals(*target_, EqualOptions().diff_sink(&formatted))); |
| 105 | ASSERT_EQ(formatted.str(), formatted_expected) |
| 106 | << "Array::Equals formatted diff incorrectly"; |
| 107 | } |
| 108 | |
| 109 | void AssertInsertIs(const std::string& insert_json) { |
| 110 | AssertArraysEqual(*ArrayFromJSON(boolean(), insert_json), *insert_, /*verbose=*/true); |
nothing calls this directly
no test coverage detected