blob: 143b0726851a2e6e52b183888eec98229967d281 (
plain) (
tree)
|
|
// SPDX-License-Identifier: ISC
// Copyright © 2022 siddharth <s@ricketyspace.net>
package file
import (
"bytes"
"testing"
)
func TestReadFile(t *testing.T) {
expectedBS := []byte("42 is the answer.\n")
bs, err := ReadFile("testdata/life.txt")
if err != nil {
t.Errorf("read file: %v", err)
return
}
if !bytes.Equal(bs, expectedBS) {
t.Errorf("read content: '%s' != '%s'", bs, expectedBS)
return
}
}
|