From 90aa56f271bf76bd829ff5b7453e65a88c73aa8a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 17 Apr 2012 18:46:35 -0700 Subject: [PATCH] os/user: simplify test Don't require the home directory to exist. Just check that it returns something. Fixes #3531 R=golang-dev, adg CC=golang-dev https://golang.org/cl/6056045 --- src/pkg/os/user/user_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pkg/os/user/user_test.go b/src/pkg/os/user/user_test.go index b812ebce79..1486fb8475 100644 --- a/src/pkg/os/user/user_test.go +++ b/src/pkg/os/user/user_test.go @@ -5,7 +5,6 @@ package user import ( - "os" "runtime" "testing" ) @@ -34,12 +33,11 @@ func TestCurrent(t *testing.T) { if err != nil { t.Fatalf("Current: %v", err) } - fi, err := os.Stat(u.HomeDir) - if err != nil || !fi.IsDir() { - t.Errorf("expected a valid HomeDir; stat(%q): err=%v", u.HomeDir, err) + if u.HomeDir == "" { + t.Errorf("didn't get a HomeDir") } if u.Username == "" { - t.Fatalf("didn't get a username") + t.Errorf("didn't get a username") } }