(c *C)
| 110 | } |
| 111 | |
| 112 | func (s *RefSpecSuite) TestRefSpecMatchGlob(c *C) { |
| 113 | tests := map[string]map[string]bool{ |
| 114 | "refs/heads/*:refs/remotes/origin/*": { |
| 115 | "refs/tag/foo": false, |
| 116 | "refs/heads/foo": true, |
| 117 | }, |
| 118 | "refs/heads/*bc:refs/remotes/origin/*bc": { |
| 119 | "refs/heads/abc": true, |
| 120 | "refs/heads/bc": true, |
| 121 | "refs/heads/abx": false, |
| 122 | }, |
| 123 | "refs/heads/a*c:refs/remotes/origin/a*c": { |
| 124 | "refs/heads/abc": true, |
| 125 | "refs/heads/ac": true, |
| 126 | "refs/heads/abx": false, |
| 127 | }, |
| 128 | "refs/heads/ab*:refs/remotes/origin/ab*": { |
| 129 | "refs/heads/abc": true, |
| 130 | "refs/heads/ab": true, |
| 131 | "refs/heads/xbc": false, |
| 132 | }, |
| 133 | } |
| 134 | |
| 135 | for specStr, data := range tests { |
| 136 | spec := RefSpec(specStr) |
| 137 | for ref, matches := range data { |
| 138 | c.Assert(spec.Match(plumbing.ReferenceName(ref)), |
| 139 | Equals, |
| 140 | matches, |
| 141 | Commentf("while matching spec %q against ref %q", specStr, ref), |
| 142 | ) |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func (s *RefSpecSuite) TestRefSpecDst(c *C) { |
| 148 | spec := RefSpec("refs/heads/master:refs/remotes/origin/master") |
nothing calls this directly
no test coverage detected