Skip to content

Commit

Permalink
Add validation tests for field type uri_no. IQSS#7117
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Jul 23, 2020
1 parent 1e0adac commit ca72420
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,20 @@ private static Stream<Arguments> provider_testIsValid() {

// URL
Arguments.of(DatasetFieldType.FieldType.URL, "http://foo.bar", true),
Arguments.of(DatasetFieldType.FieldType.URL, "foo.bar", false)
Arguments.of(DatasetFieldType.FieldType.URL, "foo.bar", false),
Arguments.of(DatasetFieldType.FieldType.URL, "rsync://foo.bar", false),

// non-opaque URIs (being URLs), see #7117
Arguments.of(DatasetFieldType.FieldType.URI_NO, "fish://foo.bar", true),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "http://foo.bar/hello", true),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "http://foo.bar/hello#rack-1", true),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "http://foo.bar/hello?whoami=peter", true),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "http://foo.bar/hello?whoami=peter#test", true),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "rsync://foo.bar/target", true),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "smb://foo.bar/share/folder/file.csv", true),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "foo.bar", false),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "scheme:foo.bar", false),
Arguments.of(DatasetFieldType.FieldType.URI_NO, "urn:isbn:1234567890", false)
);
}

Expand Down

0 comments on commit ca72420

Please sign in to comment.