(t *testing.T)
| 1105 | } |
| 1106 | |
| 1107 | func TestDoSuppress(t *testing.T) { |
| 1108 | for _, tt := range []struct { |
| 1109 | name string |
| 1110 | input Report |
| 1111 | supressRegex []string |
| 1112 | expected Report |
| 1113 | }{ |
| 1114 | { |
| 1115 | name: "noop", |
| 1116 | input: Report{}, |
| 1117 | supressRegex: []string{}, |
| 1118 | expected: Report{}, |
| 1119 | }, |
| 1120 | { |
| 1121 | name: "simple", |
| 1122 | input: Report{ |
| 1123 | Entries: []ReportEntry{ |
| 1124 | { |
| 1125 | Diffs: diffStrings("hello: world", "hello: world2", false), |
| 1126 | }, |
| 1127 | }, |
| 1128 | }, |
| 1129 | supressRegex: []string{}, |
| 1130 | expected: Report{ |
| 1131 | Entries: []ReportEntry{ |
| 1132 | { |
| 1133 | Diffs: diffStrings("hello: world", "hello: world2", false), |
| 1134 | }, |
| 1135 | }, |
| 1136 | }, |
| 1137 | }, |
| 1138 | { |
| 1139 | name: "ignore all", |
| 1140 | input: Report{ |
| 1141 | Entries: []ReportEntry{ |
| 1142 | { |
| 1143 | Diffs: diffStrings("hello: world", "hello: world2", false), |
| 1144 | }, |
| 1145 | }, |
| 1146 | }, |
| 1147 | supressRegex: []string{".*world2?"}, |
| 1148 | expected: Report{ |
| 1149 | Entries: []ReportEntry{ |
| 1150 | { |
| 1151 | Diffs: []difflib.DiffRecord{}, |
| 1152 | }, |
| 1153 | }, |
| 1154 | }, |
| 1155 | }, |
| 1156 | { |
| 1157 | name: "ignore partial", |
| 1158 | input: Report{ |
| 1159 | Entries: []ReportEntry{ |
| 1160 | { |
| 1161 | Diffs: diffStrings("hello: world", "hello: world2", false), |
| 1162 | }, |
| 1163 | }, |
| 1164 | }, |
nothing calls this directly
no test coverage detected