* * Returns a nice diff table where the left is the expect and the right * is the actual. each entry in expect and actual will contain the key * and the corresponding value. */
(expect, actual map[string]string)
| 1072 | * and the corresponding value. |
| 1073 | */ |
| 1074 | func sprintDiffHeader(expect, actual map[string]string) string { |
| 1075 | diff := jsonDiff.CompareHeaders(expect, actual) |
| 1076 | |
| 1077 | // If both sides render to nothing, skip the row entirely. |
| 1078 | if isBlankPair(diff.Expected, diff.Actual) { |
| 1079 | return "" |
| 1080 | } |
| 1081 | |
| 1082 | if len(diff.Expected) > maxLineLength || len(diff.Actual) > maxLineLength { |
| 1083 | return expectActualTable(diff.Expected, diff.Actual, "header", false) // Don't centerize |
| 1084 | } |
| 1085 | return expectActualTable(diff.Expected, diff.Actual, "header", true) |
| 1086 | } |
| 1087 | |
| 1088 | /* |
| 1089 | * Returns a nice diff table where the left is the expect and the right |
no test coverage detected