(t *testing.T)
| 219 | } |
| 220 | |
| 221 | func Test_pathDepth(t *testing.T) { |
| 222 | t.Parallel() |
| 223 | |
| 224 | useCases := []struct { |
| 225 | name string |
| 226 | dir string |
| 227 | want int |
| 228 | }{ |
| 229 | { |
| 230 | name: "want one depth when empty directory", |
| 231 | want: 1, |
| 232 | }, |
| 233 | { |
| 234 | name: "want one depth when simple directory", |
| 235 | dir: "a", |
| 236 | want: 1, |
| 237 | }, |
| 238 | { |
| 239 | name: "want 2 depth when sub directory", |
| 240 | dir: "a/a", |
| 241 | want: 2, |
| 242 | }, |
| 243 | { |
| 244 | name: "want 3 depth when sub directory", |
| 245 | dir: "a-a/b_bb__/cccc/", |
| 246 | want: 3, |
| 247 | }, |
| 248 | } |
| 249 | |
| 250 | for _, uc := range useCases { |
| 251 | t.Run(uc.name, func(t *testing.T) { |
| 252 | if got, want := pathDepth(uc.dir), uc.want; got != want { |
| 253 | t.Errorf("unexpected pathDepth, got:%v, want:%v", got, want) |
| 254 | } |
| 255 | }) |
| 256 | } |
| 257 | } |
nothing calls this directly
no test coverage detected