Skip to content

Commit dda393b

Browse files
committed
Add failing case
1 parent c49a03b commit dda393b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<script src="../src/match/Mention.js"></script>
3131
<script src="../src/match/Url.js"></script>
3232
<script src="../src/matcher/Matcher.js"></script>
33+
<script src="../src/matcher/TldRegex.js"></script>
3334
<script src="../src/matcher/Email.js"></script>
3435
<script src="../src/matcher/Hashtag.js"></script>
3536
<script src="../src/matcher/Phone.js"></script>

tests/matcher/UrlSpec.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ describe( "Autolinker.matcher.Url", function() {
77
matcher = new Autolinker.matcher.Url( {
88
tagBuilder : new Autolinker.AnchorTagBuilder(),
99
stripPrefix : false,
10-
stripTrailingSlash : false
10+
stripTrailingSlash : false,
11+
decodePercentEncoding: false
1112
} );
1213
} );
1314

@@ -161,6 +162,12 @@ describe( "Autolinker.matcher.Url", function() {
161162
expect( matches.length ).toBe( 0 );
162163
} );
163164

165+
it( 'should parse long contiguous characters with no spaces in a timely manner', function() {
166+
const start = Date.now();
167+
matcher.parseMatches( new Array(10000).join('a') );
168+
expect( Date.now() - start ).toBeLessThan( 100 );
169+
} );
170+
164171
} );
165172

166173
} );

0 commit comments

Comments
 (0)