aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/internal/sandbox/assert.go6
-rw-r--r--test/internal/sandbox/assert_test.go4
-rw-r--r--test/internal/sandbox/fs.go4
-rw-r--r--test/internal/sandbox/mount_test.go4
4 files changed, 9 insertions, 9 deletions
diff --git a/test/internal/sandbox/assert.go b/test/internal/sandbox/assert.go
index 82c928b0..343c1586 100644
--- a/test/internal/sandbox/assert.go
+++ b/test/internal/sandbox/assert.go
@@ -17,7 +17,7 @@ import (
"log"
"net"
"os"
- "path"
+ "path/filepath"
"syscall"
)
@@ -54,7 +54,7 @@ func (t *T) MustCheckFile(wantFilePath string) {
}
func mustAbs(s string) string {
- if !path.IsAbs(s) {
+ if !filepath.IsAbs(s) {
fatalf("[FAIL] %q is not absolute", s)
panic("unreachable")
}
@@ -68,7 +68,7 @@ func (t *T) MustCheck(want *TestCase) {
os.Getenv("XDG_RUNTIME_DIR"),
}
for _, a := range checkWritableDirPaths {
- pathname := path.Join(mustAbs(a), ".hakurei-check")
+ pathname := filepath.Join(mustAbs(a), ".hakurei-check")
if err := os.WriteFile(pathname, make([]byte, 1<<8), 0600); err != nil {
fatalf("[FAIL] %s", err)
} else if err = os.Remove(pathname); err != nil {
diff --git a/test/internal/sandbox/assert_test.go b/test/internal/sandbox/assert_test.go
index efeb7cb3..012ae23d 100644
--- a/test/internal/sandbox/assert_test.go
+++ b/test/internal/sandbox/assert_test.go
@@ -5,7 +5,7 @@ package sandbox
import (
"encoding/json"
"os"
- "path"
+ "path/filepath"
"testing"
)
@@ -15,7 +15,7 @@ func SwapPrint(f F) (old F) { old = printfFunc; printfFunc = f; return }
func SwapFatal(f F) (old F) { old = fatalfFunc; fatalfFunc = f; return }
func MustWantFile(t *testing.T, v any) (wantFile string) {
- wantFile = path.Join(t.TempDir(), "want.json")
+ wantFile = filepath.Join(t.TempDir(), "want.json")
if f, err := os.OpenFile(wantFile, os.O_CREATE|os.O_WRONLY, 0400); err != nil {
t.Fatalf("cannot create %q: %v", wantFile, err)
} else if err = json.NewEncoder(f).Encode(v); err != nil {
diff --git a/test/internal/sandbox/fs.go b/test/internal/sandbox/fs.go
index 36d6c6d3..b37d30b9 100644
--- a/test/internal/sandbox/fs.go
+++ b/test/internal/sandbox/fs.go
@@ -6,7 +6,7 @@ import (
"errors"
"fmt"
"io/fs"
- "path"
+ "path/filepath"
"strings"
)
@@ -68,7 +68,7 @@ func (s *FS) Compare(prefix string, e fs.FS) error {
printDir(prefix, dir)
return ErrFSInvalidEnt
} else {
- name = path.Join(prefix, name)
+ name = filepath.Join(prefix, name)
if fi, err := got.Info(); err != nil {
return err
diff --git a/test/internal/sandbox/mount_test.go b/test/internal/sandbox/mount_test.go
index 65bcec43..a565b0a0 100644
--- a/test/internal/sandbox/mount_test.go
+++ b/test/internal/sandbox/mount_test.go
@@ -4,7 +4,7 @@ package sandbox_test
import (
"os"
- "path"
+ "path/filepath"
"testing"
"hakurei.app/test/internal/sandbox"
@@ -87,7 +87,7 @@ func TestMountinfo(t *testing.T) {
}
for _, tc := range testCases {
- name := path.Join(t.TempDir(), "sample")
+ name := filepath.Join(t.TempDir(), "sample")
if err := os.WriteFile(name, []byte(tc.sample), 0400); err != nil {
t.Fatalf("cannot write sample: %v", err)
}