diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-07-27 22:35:47 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-07-27 22:35:47 +0200 |
commit | 694ac808eba5c0036343d4acc2d1692a54677645 (patch) | |
tree | 60c39d03aa8cad310e3dee74cde101c76cd78526 /skate | |
parent | 042ed5693d951205f5153c1868eeb29f8398f688 (diff) | |
download | refcat-694ac808eba5c0036343d4acc2d1692a54677645.tar.gz refcat-694ac808eba5c0036343d4acc2d1692a54677645.zip |
tests: use more sensible names
Diffstat (limited to 'skate')
-rw-r--r-- | skate/reduce_test.go | 4 | ||||
-rw-r--r-- | skate/testutil/extra.go | 8 |
2 files changed, 6 insertions, 6 deletions
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 |