Skip to content

Commit

Permalink
Add test cases from #44 that now work correctly on this branch
Browse files Browse the repository at this point in the history
  • Loading branch information
robinst committed Jul 11, 2022
1 parent 74e3e39 commit 0f5b2e9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/url.rs
Expand Up @@ -441,6 +441,30 @@ fn avoid_multiple_matches_without_protocol() {
assert_eq!(links[0].as_str(), "http://example.com");
}

#[test]
fn without_protocol_and_email() {
let mut finder = LinkFinder::new();
finder.url_must_have_scheme(false);

assert_linked_with(
&finder,
"Look, no scheme: example.org/foo email@foo.com",
"Look, no scheme: |example.org/foo| |email@foo.com|",
);

assert_linked_with(
&finder,
"Web:
www.foobar.co
E-Mail:
bar@foobar.co (bla bla bla)",
"Web:
|www.foobar.co|
E-Mail:
|bar@foobar.co| (bla bla bla)",
);
}

#[test]
fn fuzz() {
assert_not_linked("ab:/ϸ");
Expand Down

0 comments on commit 0f5b2e9

Please sign in to comment.