Skip to content

Commit f07f281

Browse files
authored
Add more tests for isUri and isHostname (#346)
1 parent 539c398 commit f07f281

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tools/protovalidate-conformance/internal/cases/cases_is_hostname.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,13 @@ func isHostnameSuite() suites.Suite {
220220
},
221221
),
222222
},
223+
"invalid/fuzz1": {
224+
Message: &cases.IsHostname{Val: "İ"},
225+
Expected: results.Violations(
226+
&validate.Violation{
227+
ConstraintId: proto.String("library.is_hostname"),
228+
},
229+
),
230+
},
223231
}
224232
}

tools/protovalidate-conformance/internal/cases/cases_is_uri.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,5 +900,9 @@ func isURISuite() suites.Suite {
900900
Message: &cases.IsUri{Val: "https://example.com/#0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-._~%20!$&'()*+,=;:@?/"},
901901
Expected: results.Success(true),
902902
},
903+
"valid/fuzz1": {
904+
Message: &cases.IsUri{Val: "A://"},
905+
Expected: results.Success(true),
906+
},
903907
}
904908
}

0 commit comments

Comments
 (0)