MCPcopy Create free account
hub / github.com/gogs/gogs / TestCustomDir

Function TestCustomDir

internal/conf/computed_test.go:74–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

72}
73
74func TestCustomDir(t *testing.T) {
75 tests := []struct {
76 env string
77 want string
78 }{
79 {env: "GOGS_CUSTOM=/tmp", want: "/tmp"},
80 {env: "", want: CustomDir()},
81 }
82 for _, test := range tests {
83 t.Run("", func(t *testing.T) {
84 out, err := testutil.Exec("TestCustomDirHelper", test.env)
85 if err != nil {
86 t.Fatal(err)
87 }
88
89 assert.Equal(t, test.want, out)
90 })
91 }
92}
93
94func TestHomeDirHelper(_ *testing.T) {
95 if !testutil.WantHelperProcess() {

Callers

nothing calls this directly

Calls 2

ExecFunction · 0.92
CustomDirFunction · 0.85

Tested by

no test coverage detected