From 4f332f79e74c34224b74286536c151403cb3cf92 Mon Sep 17 00:00:00 2001 From: Albert Z Wang Date: Wed, 29 Nov 2017 14:01:03 -0500 Subject: [PATCH] clean paths in test comparisons --- basepath_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basepath_test.go b/basepath_test.go index 33d310d..9001322 100644 --- a/basepath_test.go +++ b/basepath_test.go @@ -151,7 +151,7 @@ func TestBasePathOpenFile(t *testing.T) { if err != nil { t.Fatalf("failed to open file: %v", err) } - if filepath.Dir(f.Name()) != "/tmp" { + if filepath.Dir(f.Name()) != filepath.Clean("/tmp") { t.Fatalf("realpath leaked: %s", f.Name()) } } @@ -164,7 +164,7 @@ func TestBasePathCreate(t *testing.T) { if err != nil { t.Fatalf("failed to create file: %v", err) } - if filepath.Dir(f.Name()) != "/tmp" { + if filepath.Dir(f.Name()) != filepath.Clean("/tmp") { t.Fatalf("realpath leaked: %s", f.Name()) } } @@ -179,7 +179,7 @@ func TestBasePathTempFile(t *testing.T) { t.Fatalf("Failed to TempDir: %v", err) } fmt.Println(tDir) - if filepath.Dir(tDir) != "/tmp" { + if filepath.Dir(tDir) != filepath.Clean("/tmp") { t.Fatalf("Tempdir realpath leaked: %s", tDir) } tempFile, err := TempFile(bp, tDir, "")