Subramanya Sastry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/81712
Change subject: ParserTests: set page name for all tests (since env is reused)
......................................................................
ParserTests: set page name for all tests (since env is reused)
* When I was updating parser tests with updates to data-mw, I was
getting strange failures which I narrowed down to updates to
relativeLinkPrefix (as part of setPageName). parser-tests reuses
the same env object for all tests => it should set page name
for all tests.
Change-Id: Iffbab8bc773c6305702f9a82afc6f294bc5b0efd
---
M js/tests/parserTests.js
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid
refs/changes/12/81712/1
diff --git a/js/tests/parserTests.js b/js/tests/parserTests.js
index fedee0d..bc62e41 100755
--- a/js/tests/parserTests.js
+++ b/js/tests/parserTests.js
@@ -767,7 +767,13 @@
// Strip the [[]] markers.
var title = item.options.title.replace( /^\[\[|\]\]$/g,
'' );
title = this.env.normalizeTitle( title, true );
+ // This sets the page name as well as the relative link
prefix
+ // for the rest of the parse.
this.env.setPageName( title );
+ } else {
+ // Since we are reusing the 'env' object, set it to
Main Page
+ // so that relative link prefix is back to "./"
+ this.env.setPageName( "Main Page" );
}
if ( item.options.subpage !== undefined ) {
--
To view, visit https://gerrit.wikimedia.org/r/81712
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffbab8bc773c6305702f9a82afc6f294bc5b0efd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits