| 556 | |
| 557 | template <typename T> |
| 558 | void operator<<(const DiffBase<T>& diff) { |
| 559 | if (!diff.isDifferent()) return; |
| 560 | different = true; |
| 561 | |
| 562 | const auto space = outputFormat != OutputFormat::json_mini ? " " : ""; |
| 563 | const auto nl = outputFormat != OutputFormat::json_mini ? "\n" : ""; |
| 564 | |
| 565 | if (outputFormat == OutputFormat::text) { |
| 566 | printContext(); |
| 567 | if (diff.hasValue(0)) |
| 568 | printIndent(0, "-{}: {}\n", diff.textHeader, diff.value(0, outputFormat)); |
| 569 | if (diff.hasValue(1)) |
| 570 | printIndent(0, "+{}: {}\n", diff.textHeader, diff.value(1, outputFormat)); |
| 571 | } else { |
| 572 | beginJsonOutput(); |
| 573 | printIndent(2, "\"{}\":{}[{}", diff.jsonPath, space, nl); |
| 574 | if (diff.hasValue(0)) |
| 575 | printIndent(3, "{},{}", diff.value(0, outputFormat), nl); |
| 576 | else |
| 577 | printIndent(3, "null,{}", nl); |
| 578 | if (diff.hasValue(1)) |
| 579 | printIndent(3, "{}{}", diff.value(1, outputFormat), nl); |
| 580 | else |
| 581 | printIndent(3, "null{}", nl); |
| 582 | printIndent(2, "]"); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | template <typename T> |
| 587 | void operator<<(const DiffComplex<T>& diff) { |
nothing calls this directly
no test coverage detected