MCPcopy Create free account
hub / github.com/go-git/go-git / TestValidateBadPath

Method TestValidateBadPath

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected