(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestBuildForwardSubject(t *testing.T) { |
| 10 | cases := []struct { |
| 11 | in, want string |
| 12 | }{ |
| 13 | {"Hello", "Fwd: Hello"}, |
| 14 | {" Hello ", "Fwd: Hello"}, |
| 15 | {"", "Fwd: (no subject)"}, |
| 16 | {"Fwd: Hello", "Fwd: Hello"}, |
| 17 | {"fwd: lower", "fwd: lower"}, |
| 18 | {"Fw: short form", "Fw: short form"}, |
| 19 | {"FW: caps", "FW: caps"}, |
| 20 | } |
| 21 | for _, c := range cases { |
| 22 | got := BuildForwardSubject(c.in) |
| 23 | if got != c.want { |
| 24 | t.Errorf("BuildForwardSubject(%q) = %q, want %q", c.in, got, c.want) |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestExtractForwardContext_TextPlain(t *testing.T) { |
| 30 | raw := []byte("From: alice@example.com\r\n" + |
nothing calls this directly
no test coverage detected