aboutsummaryrefslogtreecommitdiff
path: root/pkg/rfc822/writer_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/rfc822/writer_test.go')
-rw-r--r--pkg/rfc822/writer_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/rfc822/writer_test.go b/pkg/rfc822/writer_test.go
index 7beae8d..34c9d4a 100644
--- a/pkg/rfc822/writer_test.go
+++ b/pkg/rfc822/writer_test.go
@@ -34,10 +34,14 @@ func TestRfc822Writer_Write(t *testing.T) {
t.Run(tt.before, func(t *testing.T) {
b := bytes.Buffer{}
w := Writer(&b)
- if _, err := io.WriteString(w, tt.before); err != nil {
+ n, err := io.WriteString(w, tt.before)
+ if err != nil {
t.Errorf("Error: %v", err)
return
}
+ if n != len(tt.before) {
+ t.Errorf("Unexpected number of bytes written: %d, expected: %d", n, len(tt.before))
+ }
res := b.String()
if tt.after != res {
t.Errorf("Expected: %q, got: %q", tt.after, res)