forked from linkedin/URL-Detector
-
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.
Remove endless loop detection to address linkedin#15.
So the obvious downside is the risk of actually getting into an endless loop but I think the risk is worth it. If the code is solid then this is not possible, so I'd rather address those cases as (if?) they come up, instead causing false failures like the case in this issue.
- Loading branch information
1 parent
e016ac9
commit 940784b
Showing
4 changed files
with
36 additions
and
62 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
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 |
---|---|---|
|
@@ -649,6 +649,42 @@ public void testBacktrackInvalidUsernamePassword() { | |
runTest("http://hello:asdf.com", UrlDetectorOptions.Default, "asdf.com"); | ||
} | ||
|
||
/* | ||
* https://github.com/linkedin/URL-Detector/issues/12 | ||
*/ | ||
@Test | ||
public void testIssue12() { | ||
runTest("http://user:[email protected] host.com", UrlDetectorOptions.Default, "http://user:[email protected]", "host.com"); | ||
} | ||
|
||
/* | ||
* https://github.com/linkedin/URL-Detector/issues/13 | ||
*/ | ||
@Test | ||
public void testIssue13() { | ||
runTest("[email protected]/page", UrlDetectorOptions.Default, "[email protected]/page"); | ||
runTest("[email protected]", UrlDetectorOptions.Default, "[email protected]"); | ||
runTest("[email protected]", UrlDetectorOptions.Default, "[email protected]"); | ||
runTest("[email protected]", UrlDetectorOptions.Default, "[email protected]"); | ||
runTest("first.middle.reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylonglastname@gmail.com", UrlDetectorOptions.Default, "first.middle.reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylonglastname@gmail.com"); | ||
} | ||
|
||
/* | ||
* https://github.com/linkedin/URL-Detector/issues/15 | ||
*/ | ||
@Test | ||
public void testIssue15() { | ||
runTest(".............:::::::::::;;;;;;;;;;;;;;;::...............................................:::::::::::::::::::::::::::::....................", UrlDetectorOptions.Default); | ||
} | ||
|
||
/* | ||
* https://github.com/linkedin/URL-Detector/issues/16 | ||
*/ | ||
@Test | ||
public void testIssue16() { | ||
runTest("://VIVE MARINE LE PEN//:@.", UrlDetectorOptions.Default); | ||
} | ||
|
||
private void runTest(String text, UrlDetectorOptions options, String... expected) { | ||
//do the detection | ||
UrlDetector parser = new UrlDetector(text, options); | ||
|