Matěj Suchánek has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/337403 )
Change subject: Fix test_replace_tag_file_failure
......................................................................
Fix test_replace_tag_file_failure
This should better demostrate the limitations.
Change-Id: Ic3325411317fe9f12b0ca5686ce45e297887f0b6
---
M tests/textlib_tests.py
1 file changed, 3 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/03/337403/2
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 2cabf39..62e5caf 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1300,16 +1300,15 @@
'x', 'y', ['file'], site=self.site),
'[[File:a|[[foo]] [[bar [invalid ]].x]][[y]]')
- @unittest.expectedFailure
def test_replace_tag_file_failure(self):
"""Test showing limits of the file link regex."""
- # When the double brackets are unbalanced, the regex
+ # When the double brackets are nested, the regex
# does not correctly detect the end of the file link.
self.assertEqual(
textlib.replaceExcept(
- '[[File:a|[[foo]] [[bar [[invalid ]].x]][[x]]',
+ '[[File:a|[[foo]] [[bar [[invalid]] baz]].x]][[x]]',
'x', 'y', ['file'], site=self.site),
- '[[File:a|[[foo]] [[bar [invalid] ]].x]][[y]]')
+ '[[File:a|[[foo]] [[bar [[invalid]] baz]].y]][[y]]')
def test_replace_tags_interwiki(self):
"""Test replacing not inside interwiki links."""
--
To view, visit https://gerrit.wikimedia.org/r/337403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3325411317fe9f12b0ca5686ce45e297887f0b6
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits