Commit 90aa56f2 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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
parent b2c61168
......@@ -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")
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment