summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2023-01-18 05:05:12 -0600
committerptmcg <ptmcg@austin.rr.com>2023-01-18 05:05:12 -0600
commit18d3eb26978e2b935ede97744d398fb6bfe5982b (patch)
tree37163f3c5447f6a6a05282e77a6eb158db065dca
parenta29ec51c1eed55c90db61afcb937ab8beaf6f60c (diff)
downloadpyparsing-git-18d3eb26978e2b935ede97744d398fb6bfe5982b.tar.gz
Remove ^ and $ tags from pp.common.url regex - fixes #459
-rw-r--r--tests/test_unit.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/test_unit.py b/tests/test_unit.py
index 96cbe28..2bb37a5 100644
--- a/tests/test_unit.py
+++ b/tests/test_unit.py
@@ -6405,21 +6405,19 @@ class Test02_WithoutPackrat(ppt.TestParseResultsAsserts, TestCase):
self.assertParseAndCheckDict(ppc.url, sample_url, expected, verbose=True)
def testCommonUrlExprs(self):
- def extract_parts(s, split=' '):
+ def extract_parts(s, split=" "):
return [[_.strip(split)] for _ in s.strip(split).split(split)]
test_string = "http://example.com https://blah.org "
self.assertParseAndCheckList(
- pp.Group(ppc.url)[...],
- test_string,
- extract_parts(test_string)
+ pp.Group(ppc.url)[...], test_string, extract_parts(test_string)
)
test_string = test_string.replace(" ", " , ")
self.assertParseAndCheckList(
pp.delimited_list(pp.Group(ppc.url), allow_trailing_delim=True),
test_string,
- extract_parts(test_string, " , ")
+ extract_parts(test_string, " , "),
)
def testNumericExpressions(self):