~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to debian/patches/014-dont_fail_test_with_missing_homedir.patch

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2012-05-02 15:44:59 UTC
  • mfrom: (14.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120502154459-wcmy8ao1325ml619
Tags: 2:1.0.1-1
* Imported Upstream version 1.0.1
* Apply godoc patch to display package list correctly (Closes: #669354)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
--- a/src/pkg/os/user/user_test.go
2
2
+++ b/src/pkg/os/user/user_test.go
3
 
@@ -35,7 +35,7 @@ func TestCurrent(t *testing.T) {
 
3
@@ -5,7 +5,6 @@
 
4
 package user
 
5
 
 
6
 import (
 
7
-       "os"
 
8
        "runtime"
 
9
        "testing"
 
10
 )
 
11
@@ -34,12 +33,11 @@ func TestCurrent(t *testing.T) {
 
12
        if err != nil {
4
13
                t.Fatalf("Current: %v", err)
5
14
        }
6
 
        fi, err := os.Stat(u.HomeDir)
 
15
-       fi, err := os.Stat(u.HomeDir)
7
16
-       if err != nil || !fi.IsDir() {
8
 
+       if err != nil {
9
 
                t.Errorf("expected a valid HomeDir; stat(%q): err=%v", u.HomeDir, err)
 
17
-               t.Errorf("expected a valid HomeDir; stat(%q): err=%v", u.HomeDir, err)
 
18
+       if u.HomeDir == "" {
 
19
+               t.Errorf("didn't get a HomeDir")
10
20
        }
11
21
        if u.Username == "" {
 
22
-               t.Fatalf("didn't get a username")
 
23
+               t.Errorf("didn't get a username")
 
24
        }
 
25
 }
 
26