MCPcopy Index your code
hub / github.com/go-git/go-git / TestValidateBadPath

Method TestValidateBadPath

config/modules_test.go:18–40  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

16}
17
18func (s *ModulesSuite) TestValidateBadPath(c *C) {
19 input := []string{
20 `..`,
21 `../`,
22 `../bar`,
23
24 `/..`,
25 `/../bar`,
26
27 `foo/..`,
28 `foo/../`,
29 `foo/../bar`,
30 }
31
32 for _, p := range input {
33 m := &Submodule{
34 Name: "ok",
35 Path: p,
36 URL: "https://example.com/",
37 }
38 c.Assert(m.Validate(), Equals, ErrModuleBadPath)
39 }
40}
41
42func (s *ModulesSuite) TestValidateMissingName(c *C) {
43 m := &Submodule{Name: "ok", URL: "bar"}

Callers

nothing calls this directly

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected