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

Method Assert

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

Source from the content-addressed store, hash-verified

34}
35
36func (c *ExpandPathTestCase) Assert(t *testing.T) {
37 if c.currentUser != nil {
38 oldCurrentUser := currentUser
39 currentUser = c.currentUser
40 defer func() { currentUser = oldCurrentUser }()
41 }
42
43 if c.lookupUser != nil {
44 oldLookupUser := lookupUser
45 lookupUser = c.lookupUser
46 defer func() { lookupUser = oldLookupUser }()
47 }
48
49 got, err := ExpandPath(c.Path, c.Expand)
50 if err != nil || len(c.WantErr) > 0 {
51 assert.EqualError(t, err, c.WantErr)
52 }
53 assert.Equal(t, filepath.ToSlash(c.Want), filepath.ToSlash(got))
54}
55
56func TestExpandPath(t *testing.T) {
57 for desc, c := range map[string]*ExpandPathTestCase{

Callers

nothing calls this directly

Calls 2

ExpandPathFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected