@@ -1916,6 +1916,145 @@ func stringSuite() suites.Suite {
19161916 },
19171917 ),
19181918 },
1919+ "protobuf_fqn/buf.validate/valid" : {
1920+ Message : & cases.StringProtobufFQN {Val : "buf.validate" },
1921+ Expected : results .Success (true ),
1922+ },
1923+ "protobuf_fqn/my_package.MyMessage/valid" : {
1924+ Message : & cases.StringProtobufFQN {Val : "my_package.MyMessage" },
1925+ Expected : results .Success (true ),
1926+ },
1927+ "protobuf_fqn/_any_Crazy_CASE_with_01234_numbers/valid" : {
1928+ Message : & cases.StringProtobufFQN {Val : "_any_Crazy_CASE_with_01234_numbers" },
1929+ Expected : results .Success (true ),
1930+ },
1931+ "protobuf_fqn/c3p0/valid" : {
1932+ Message : & cases.StringProtobufFQN {Val : "c3p0" },
1933+ Expected : results .Success (true ),
1934+ },
1935+ "protobuf_fqn/leading_dot/invalid" : {
1936+ Message : & cases.StringProtobufFQN {Val : ".x" },
1937+ Expected : results .Violations (
1938+ & validate.Violation {
1939+ Field : results .FieldPath ("val" ),
1940+ Rule : results .FieldPath ("string.protobuf_fqn" ),
1941+ RuleId : proto .String ("string.protobuf_fqn" ),
1942+ },
1943+ ),
1944+ },
1945+ "protobuf_fqn/empty/invalid" : {
1946+ Message : & cases.StringProtobufFQN {Val : "" },
1947+ Expected : results .Violations (
1948+ & validate.Violation {
1949+ Field : results .FieldPath ("val" ),
1950+ Rule : results .FieldPath ("string.protobuf_fqn" ),
1951+ RuleId : proto .String ("string.protobuf_fqn_empty" ),
1952+ },
1953+ ),
1954+ },
1955+ "protobuf_fqn/trailing_dot/invalid" : {
1956+ Message : & cases.StringProtobufFQN {Val : "x." },
1957+ Expected : results .Violations (
1958+ & validate.Violation {
1959+ Field : results .FieldPath ("val" ),
1960+ Rule : results .FieldPath ("string.protobuf_fqn" ),
1961+ RuleId : proto .String ("string.protobuf_fqn" ),
1962+ },
1963+ ),
1964+ },
1965+ "protobuf_fqn/double_dot/invalid" : {
1966+ Message : & cases.StringProtobufFQN {Val : "a..b" },
1967+ Expected : results .Violations (
1968+ & validate.Violation {
1969+ Field : results .FieldPath ("val" ),
1970+ Rule : results .FieldPath ("string.protobuf_fqn" ),
1971+ RuleId : proto .String ("string.protobuf_fqn" ),
1972+ },
1973+ ),
1974+ },
1975+ "protobuf_fqn/leading_digit/invalid" : {
1976+ Message : & cases.StringProtobufFQN {Val : "1a" },
1977+ Expected : results .Violations (
1978+ & validate.Violation {
1979+ Field : results .FieldPath ("val" ),
1980+ Rule : results .FieldPath ("string.protobuf_fqn" ),
1981+ RuleId : proto .String ("string.protobuf_fqn" ),
1982+ },
1983+ ),
1984+ },
1985+ "protobuf_fqn/bad_char/invalid" : {
1986+ Message : & cases.StringProtobufFQN {Val : "a$" },
1987+ Expected : results .Violations (
1988+ & validate.Violation {
1989+ Field : results .FieldPath ("val" ),
1990+ Rule : results .FieldPath ("string.protobuf_fqn" ),
1991+ RuleId : proto .String ("string.protobuf_fqn" ),
1992+ },
1993+ ),
1994+ },
1995+ "protobuf_dot_fqn/.buf.validate/valid" : {
1996+ Message : & cases.StringProtobufDotFQN {Val : ".buf.validate" },
1997+ Expected : results .Success (true ),
1998+ },
1999+ "protobuf_dot_fqn/.my_package.MyMessage/valid" : {
2000+ Message : & cases.StringProtobufDotFQN {Val : ".my_package.MyMessage" },
2001+ Expected : results .Success (true ),
2002+ },
2003+ "protobuf_dot_fqn/._any_Crazy_CASE_with_01234_numbers/valid" : {
2004+ Message : & cases.StringProtobufDotFQN {Val : "._any_Crazy_CASE_with_01234_numbers" },
2005+ Expected : results .Success (true ),
2006+ },
2007+ "protobuf_dot_fqn/empty/invalid" : {
2008+ Message : & cases.StringProtobufDotFQN {Val : "" },
2009+ Expected : results .Violations (
2010+ & validate.Violation {
2011+ Field : results .FieldPath ("val" ),
2012+ Rule : results .FieldPath ("string.protobuf_dot_fqn" ),
2013+ RuleId : proto .String ("string.protobuf_dot_fqn_empty" ),
2014+ },
2015+ ),
2016+ },
2017+ "protobuf_dot_fqn/trailing_dot/invalid" : {
2018+ Message : & cases.StringProtobufDotFQN {Val : ".x." },
2019+ Expected : results .Violations (
2020+ & validate.Violation {
2021+ Field : results .FieldPath ("val" ),
2022+ Rule : results .FieldPath ("string.protobuf_dot_fqn" ),
2023+ RuleId : proto .String ("string.protobuf_dot_fqn" ),
2024+ },
2025+ ),
2026+ },
2027+ "protobuf_dot_fqn/double_dot/invalid" : {
2028+ Message : & cases.StringProtobufDotFQN {Val : ".a..b" },
2029+ Expected : results .Violations (
2030+ & validate.Violation {
2031+ Field : results .FieldPath ("val" ),
2032+ Rule : results .FieldPath ("string.protobuf_dot_fqn" ),
2033+ RuleId : proto .String ("string.protobuf_dot_fqn" ),
2034+ },
2035+ ),
2036+ },
2037+ "protobuf_dot_fqn/leading_digit/invalid" : {
2038+ Message : & cases.StringProtobufDotFQN {Val : ".1a" },
2039+ Expected : results .Violations (
2040+ & validate.Violation {
2041+ Field : results .FieldPath ("val" ),
2042+ Rule : results .FieldPath ("string.protobuf_dot_fqn" ),
2043+ RuleId : proto .String ("string.protobuf_dot_fqn" ),
2044+ },
2045+ ),
2046+ },
2047+ "protobuf_dot_fqn/bad_char/invalid" : {
2048+ Message : & cases.StringProtobufDotFQN {Val : ".a$" },
2049+ Expected : results .Violations (
2050+ & validate.Violation {
2051+ Field : results .FieldPath ("val" ),
2052+ Rule : results .FieldPath ("string.protobuf_dot_fqn" ),
2053+ RuleId : proto .String ("string.protobuf_dot_fqn" ),
2054+ },
2055+ ),
2056+ },
2057+
19192058 "example/valid" : {
19202059 Message : & cases.StringExample {Val : "foobar" },
19212060 Expected : results .Success (true ),
0 commit comments