Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59168
Change subject: Fix ParserTests.js --numchanges
......................................................................
Fix ParserTests.js --numchanges
We were using the same seed for the PRNG for each change, resulting in the
same change N times, instead of N different random changes.
Change-Id: I8dc7c37192d0fc9d82580cd821d97efb807a9f90
---
M js/tests/parserTests.js
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid
refs/changes/68/59168/1
diff --git a/js/tests/parserTests.js b/js/tests/parserTests.js
index 65f63d4..daa3b72 100755
--- a/js/tests/parserTests.js
+++ b/js/tests/parserTests.js
@@ -567,7 +567,7 @@
*/
ParserTests.prototype.generateChanges = function ( options, nonRandomChanges,
item, content, cb ) {
// Seed the random-number generator based on the item title
- var random = new alea( item.seed || item.title );
+ var random = new alea( (item.seed || '') + (item.title || '') );
// This function won't actually change anything, but it will add change
// markers to random elements.
@@ -1361,6 +1361,7 @@
tasks.push( function ( modeIndex, changesIndex
) {
return function ( cb ) {
var newitem = Util.clone( item
);
+ newitem.seed = changesIndex +
'';
newitem.changes =
item.changes[changesIndex];
newitem.otherChanges =
item.changes;
this.processTest( newitem,
options, modes[modeIndex], function () {
--
To view, visit https://gerrit.wikimedia.org/r/59168
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8dc7c37192d0fc9d82580cd821d97efb807a9f90
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits