-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for iri and iri-reference format
- Loading branch information
1 parent
be9a982
commit 526cb5f
Showing
3 changed files
with
168 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,4 +142,19 @@ void should_found_regexformat() { | |
assertThat(new Formats().findByName("regex").applyTo("^[0-9]*"), is(true)); | ||
assertThat(new Formats().findByName("regex").applyTo("({"), is(false)); | ||
} | ||
|
||
@Test | ||
void should_found_iriformat() { | ||
//α -> only looks like an a, but is not one | ||
assertThat(new Formats().findByName("iri").applyTo("http://www.myfictionαlbank.com"), is(true)); | ||
assertThat(new Formats().findByName("iri").applyTo("mailto:[email protected]"), is(true)); | ||
assertThat(new Formats().findByName("iri").applyTo("1://noIri"), is(false)); | ||
} | ||
|
||
@Test | ||
void should_found_irireferenceformat() { | ||
//α -> only looks like an a, but is not one | ||
assertThat(new Formats().findByName("iri-reference").applyTo("http://www.myfictionαlbank.com"), is(true)); | ||
assertThat(new Formats().findByName("iri-reference").applyTo("1://noIri"), is(false)); | ||
} | ||
} |