@@ -1048,6 +1048,16 @@ func stringSuite() suites.Suite {
1048
1048
},
1049
1049
),
1050
1050
},
1051
+ "uri/invalid/encoding" : {
1052
+ Message : & cases.StringURI {Val : "http://example.com/foo/bar?baz=%x" },
1053
+ Expected : results .Violations (
1054
+ & validate.Violation {
1055
+ Field : results .FieldPath ("val" ),
1056
+ Rule : results .FieldPath ("string.uri" ),
1057
+ ConstraintId : proto .String ("string.uri" ),
1058
+ },
1059
+ ),
1060
+ },
1051
1061
"uri/invalid/not_checked/empty" : {
1052
1062
Message : & cases.StringNotURI {Val : "" },
1053
1063
Expected : results .Success (true ),
@@ -1076,6 +1086,26 @@ func stringSuite() suites.Suite {
1076
1086
},
1077
1087
),
1078
1088
},
1089
+ "uri/invalid/absolute/encoding" : {
1090
+ Message : & cases.StringURI {Val : "https://example.com/foo/bar?baz=%x" },
1091
+ Expected : results .Violations (
1092
+ & validate.Violation {
1093
+ Field : results .FieldPath ("val" ),
1094
+ Rule : results .FieldPath ("string.uri" ),
1095
+ ConstraintId : proto .String ("string.uri" ),
1096
+ },
1097
+ ),
1098
+ },
1099
+ "uri/invalid/relative/encoding" : {
1100
+ Message : & cases.StringURI {Val : "/foo/bar?baz=%x" },
1101
+ Expected : results .Violations (
1102
+ & validate.Violation {
1103
+ Field : results .FieldPath ("val" ),
1104
+ Rule : results .FieldPath ("string.uri" ),
1105
+ ConstraintId : proto .String ("string.uri" ),
1106
+ },
1107
+ ),
1108
+ },
1079
1109
"uri_ref/valid/absolute" : {
1080
1110
Message : & cases.StringURIRef {Val : "https://example.com/foo/bar?baz=quux" },
1081
1111
Expected : results .Success (true ),
0 commit comments