(t *testing.T)
| 114 | "hello\r\n" |
| 115 | |
| 116 | func TestSignMessage_NoLookupConfigured(t *testing.T) { |
| 117 | // Plain NewSender → dkimLookup is nil. Must return (nil, false) |
| 118 | // without touching the message — older deployments and unit |
| 119 | // tests construct Senders this way and shouldn't break. |
| 120 | s := NewSender(nil, "example.com") |
| 121 | signed, ok := s.signMessage([]byte(validTestMessage), "example.com") |
| 122 | if ok { |
| 123 | t.Errorf("ok = true, want false (no lookup configured)") |
| 124 | } |
| 125 | if signed != nil { |
| 126 | t.Errorf("signed = %d bytes, want nil", len(signed)) |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | func TestSignMessage_EmptyDomainSkipsLookup(t *testing.T) { |
| 131 | // A pathological caller passing "" as the signing domain must |
nothing calls this directly
no test coverage detected