Clean up tests a bit more

This commit is contained in:
kadmin 2021-07-06 19:24:16 +00:00
parent 34c5677308
commit 87fc7aa6b0
2 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,2 @@
liburing/
*.so
uring-test*

View File

@ -4,6 +4,7 @@ package uring
import (
"io/ioutil"
"os"
"testing"
)
@ -12,6 +13,7 @@ func TestFile(t *testing.T) {
if err != nil {
t.Fatalf("failed to create temp file: %v", err)
}
defer os.Remove(tmpFile.Name())
f, err := NewFile(tmpFile)
if err != nil {
t.Fatalf("failed to create io_uring file: %v", err)
@ -19,7 +21,7 @@ func TestFile(t *testing.T) {
content := []byte("a test string to check writing works 😀 with non-unicode input")
n, err := f.Write(content)
if n != len(content) {
t.Errorf("mismatch between reported written len and content len: want %d, got %d", len(content), n)
t.Errorf("mismatch between written len and content len: want %d, got %d", len(content), n)
}
if err != nil {
t.Errorf("file write failed: %v", err)