MCPcopy
hub / github.com/git-lfs/git-lfs / Assert

Method Assert

tools/filetools_test.go:133–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

131}
132
133func (c *ExpandConfigPathTestCase) Assert(t *testing.T) {
134 if c.currentUser != nil {
135 oldCurrentUser := currentUser
136 currentUser = c.currentUser
137 defer func() { currentUser = oldCurrentUser }()
138 }
139
140 if c.lookupConfigHome != nil {
141 oldLookupConfigHome := lookupConfigHome
142 lookupConfigHome = c.lookupConfigHome
143 defer func() { lookupConfigHome = oldLookupConfigHome }()
144 }
145
146 got, err := ExpandConfigPath(c.Path, c.DefaultPath)
147 if err != nil || len(c.WantErr) > 0 {
148 assert.EqualError(t, err, c.WantErr)
149 }
150 assert.Equal(t, filepath.ToSlash(c.Want), filepath.ToSlash(got))
151}
152
153func TestExpandConfigPath(t *testing.T) {
154 os.Unsetenv("XDG_CONFIG_HOME")

Callers

nothing calls this directly

Calls 2

ExpandConfigPathFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected