MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestHomeDirExpand

Function TestHomeDirExpand

utils/path_test.go:52–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func 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
71func TestExist(t *testing.T) {
72 Convey("path exist or not", t, func() {

Callers

nothing calls this directly

Calls 1

HomeDirExpandFunction · 0.85

Tested by

no test coverage detected