(t *testing.T)
| 224 | } |
| 225 | |
| 226 | func TestFieldsToSign(t *testing.T) { |
| 227 | h := textproto.Header{} |
| 228 | h.Add("A", "1") |
| 229 | h.Add("c", "2") |
| 230 | h.Add("C", "3") |
| 231 | h.Add("a", "4") |
| 232 | h.Add("b", "5") |
| 233 | h.Add("unrelated", "6") |
| 234 | |
| 235 | m := Modifier{ |
| 236 | oversignHeader: []string{"A", "B"}, |
| 237 | signHeader: []string{"C"}, |
| 238 | } |
| 239 | fields := m.fieldsToSign(&h) |
| 240 | sort.Strings(fields) |
| 241 | expected := []string{"A", "A", "A", "B", "B", "C", "C"} |
| 242 | |
| 243 | if !reflect.DeepEqual(fields, expected) { |
| 244 | t.Errorf("incorrect set of fields to sign\nwant: %v\ngot: %v", expected, fields) |
| 245 | } |
| 246 | } |
nothing calls this directly
no test coverage detected