(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestHomeDirExpand(t *testing.T) { |
| 53 | Convey("expand ~ dir", t, func() { |
| 54 | usr, err := user.Current() |
| 55 | So(err, ShouldBeNil) |
| 56 | |
| 57 | homeDir := HomeDirExpand("~") |
| 58 | So(homeDir, ShouldEqual, usr.HomeDir) |
| 59 | |
| 60 | fullFilepathWithHome := HomeDirExpand("~/.local") |
| 61 | So(fullFilepathWithHome, ShouldEqual, usr.HomeDir+"/.local") |
| 62 | |
| 63 | fullFilepathRaw := HomeDirExpand("/dev/null") |
| 64 | So(fullFilepathRaw, ShouldEqual, "/dev/null") |
| 65 | |
| 66 | emptyPath := HomeDirExpand("") |
| 67 | So(emptyPath, ShouldEqual, "") |
| 68 | }) |
| 69 | } |
| 70 | |
| 71 | func TestExist(t *testing.T) { |
| 72 | Convey("path exist or not", t, func() { |
nothing calls this directly
no test coverage detected