blob: 790b459ca21c1b8e2fa062873808d74fff910564 [file] [log] [blame]
package namespace
import (
"testing"
)
func TestDepth(t *testing.T) {
cases := []struct {
name string
depth int
}{
{"", 0},
{"foo", 1},
{"foo/", 1},
{"foo/bar", 2},
{"foo//bar", 2},
{"/foo/bar", 2},
{"//", 0},
{"//foo//bar", 2},
{"/foo/bar//baz//baf/", 4},
}
for _, c := range cases {
if got, want := depth(c.name), c.depth; want != got {
t.Errorf("%q: unexpected depth: %d not %d", c.name, got, want)
}
}
}