From 694ac808eba5c0036343d4acc2d1692a54677645 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Tue, 27 Jul 2021 22:35:47 +0200 Subject: tests: use more sensible names --- skate/reduce_test.go | 4 ++-- skate/testutil/extra.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'skate') diff --git a/skate/reduce_test.go b/skate/reduce_test.go index 4ff2508..172547b 100644 --- a/skate/reduce_test.go +++ b/skate/reduce_test.go @@ -420,12 +420,12 @@ func TestZippyExact(t *testing.T) { if err != c.err { t.Errorf("[%d] got %v, want %v", i, err, c.err) } - ok, err := testutil.EqualsFilename(&buf, c.out) + ok, err := testutil.BufferFileEquals(&buf, c.out) if err != nil { t.Errorf("failed to open test file: %v", c.out) } if !ok { - filename, err := testutil.TempWriteFile(&buf) + filename, err := testutil.BufferToTemp(&buf) if err != nil { t.Logf("could not write temp file") } diff --git a/skate/testutil/extra.go b/skate/testutil/extra.go index cb533c3..7537f75 100644 --- a/skate/testutil/extra.go +++ b/skate/testutil/extra.go @@ -8,9 +8,9 @@ import ( "git.archive.org/martin/cgraph/skate/atomic" ) -// EqualsFilename returns true, if the contents of a given buffer matches the +// BufferFileEquals returns true, if the contents of a given buffer matches the // contents of a file given by filename. -func EqualsFilename(buf *bytes.Buffer, filename string) (bool, error) { +func BufferFileEquals(buf *bytes.Buffer, filename string) (bool, error) { b, err := ioutil.ReadFile(filename) if err != nil { return false, err @@ -22,9 +22,9 @@ func EqualsFilename(buf *bytes.Buffer, filename string) (bool, error) { return reflect.DeepEqual(b, bb), nil } -// TempWriteFile writes the content of a buffer to a temporary file and returns +// BufferToTemp writes the content of a buffer to a temporary file and returns // its path. -func TempWriteFile(buf *bytes.Buffer) (string, error) { +func BufferToTemp(buf *bytes.Buffer) (string, error) { f, err := ioutil.TempFile("", "skate-test-*") if err != nil { return "", err -- cgit v1.2.3