blob: 38a2f817e0a1242b72ed6fad8fe3fc115206728a [file] [log] [blame]
package mounttable
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)
}
}
}