github.com/tada-team/tdproto@v1.51.57/tdmarkup/helpers_test.go (about) 1 package tdmarkup 2 3 import "testing" 4 5 func TestIsPath(t *testing.T) { 6 for _, path := range []string{ 7 "/aa/bb/", 8 "/aa/bb/", 9 "/aa/bb/ccc/", 10 } { 11 if !isPath(path) { 12 t.Errorf("`%s` must be path", path) 13 } 14 } 15 16 for _, s := range []string{ 17 "/", 18 "//", 19 "/a/", 20 "/aa/", 21 "/aa/bb", 22 } { 23 if isPath(s) { 24 t.Errorf("`%s` must be not path", s) 25 } 26 } 27 }