pkg/ioutils: use string-literals for easier grep'ing

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-05 12:24:39 +02:00
parent 1da079f211
commit fded42c3bd
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -66,7 +66,7 @@ func TestFixedBufferString(t *testing.T) {
out := buf.String()
if out != "helloworld" {
t.Fatalf("expected output to be \"helloworld\", got %q", out)
t.Fatalf(`expected output to be "helloworld", got %q`, out)
}
// read 5 bytes
@ -76,7 +76,7 @@ func TestFixedBufferString(t *testing.T) {
// test that fixedBuffer.String() only returns the part that hasn't been read
out = buf.String()
if out != "world" {
t.Fatalf("expected output to be \"world\", got %q", out)
t.Fatalf(`expected output to be "world", got %q`, out)
}
}
@ -92,7 +92,7 @@ func TestFixedBufferWrite(t *testing.T) {
}
if string(buf.buf[:5]) != "hello" {
t.Fatalf("expected \"hello\", got %q", string(buf.buf[:5]))
t.Fatalf(`expected "hello", got %q`, string(buf.buf[:5]))
}
n, err = buf.Write(bytes.Repeat([]byte{1}, 64))
@ -121,7 +121,7 @@ func TestFixedBufferRead(t *testing.T) {
}
if string(b) != "hello" {
t.Fatalf("expected \"hello\", got %q", string(b))
t.Fatalf(`expected "hello", got %q`, string(b))
}
n, err = buf.Read(b)
@ -134,7 +134,7 @@ func TestFixedBufferRead(t *testing.T) {
}
if string(b) != " worl" {
t.Fatalf("expected \" worl\", got %s", string(b))
t.Fatalf(`expected " worl", got %s`, string(b))
}
b = b[:1]
@ -148,6 +148,6 @@ func TestFixedBufferRead(t *testing.T) {
}
if string(b) != "d" {
t.Fatalf("expected \"d\", got %s", string(b))
t.Fatalf(`expected "d", got %s`, string(b))
}
}