mirror of
https://github.com/tailscale/tailscale.git
synced 2026-04-04 14:43:42 -04:00
Clean up tests a bit more
This commit is contained in:
1
net/uring/.gitignore
vendored
1
net/uring/.gitignore
vendored
@@ -1,3 +1,2 @@
|
||||
liburing/
|
||||
*.so
|
||||
uring-test*
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user