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

Function TestWorkDir

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

Source from the content-addressed store, hash-verified

44}
45
46func TestWorkDir(t *testing.T) {
47 tests := []struct {
48 env string
49 want string
50 }{
51 {env: "GOGS_WORK_DIR=/tmp", want: "/tmp"},
52 {env: "", want: WorkDir()},
53 }
54 for _, test := range tests {
55 t.Run("", func(t *testing.T) {
56 out, err := testutil.Exec("TestWorkDirHelper", test.env)
57 if err != nil {
58 t.Fatal(err)
59 }
60
61 assert.Equal(t, test.want, out)
62 })
63 }
64}
65
66func TestCustomDirHelper(_ *testing.T) {
67 if !testutil.WantHelperProcess() {

Callers

nothing calls this directly

Calls 2

ExecFunction · 0.92
WorkDirFunction · 0.85

Tested by

no test coverage detected