Skip to content

Commit 9d4157a

Browse files
committed
1 parent aea2187 commit 9d4157a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def test_url_one_letter_iana(self):
141141
self.assertEqual(result.html, u'text <a href="http://X.org/">http://X.org/</a>')
142142
self.assertEqual(result.urls, [u'http://X.org/'])
143143

144+
def test_url_long_hypens(self):
145+
result = self.parser.parse(u'text http://word-and-a-number-8-ftw.domain.tld/')
146+
self.assertEqual(result.html, u'text <a href="http://word-and-a-number-8-ftw.domain.tld/">http://word-and-a-number-8-...</a>')
147+
self.assertEqual(result.urls, [u'http://word-and-a-number-8-ftw.domain.tld/'])
148+
144149

145150
# URL not tests ------------------------------------------------------------
146151
def test_not_url_dotdotdot(self):
@@ -230,6 +235,11 @@ def test_url_followed_semicolon(self):
230235
self.assertEqual(result.html, u'text <a href="http://example.com">http://example.com</a>;')
231236
self.assertEqual(result.urls, [u'http://example.com'])
232237

238+
def test_url_followed_hypen(self):
239+
result = self.parser.parse(u'text http://domain.tld-that-you-should-have-put-a-space-after')
240+
self.assertEqual(result.html, u'text <a href="http://domain.tld">http://domain.tld</a>-that-you-should-have-put-a-space-after')
241+
self.assertEqual(result.urls, [u'http://domain.tld'])
242+
233243

234244
# URL preceeded Tests -------------------------------------------------------
235245
def test_url_preceeded_colon(self):

0 commit comments

Comments
 (0)