docs template

integrate-easysync-tests
webzwo0i 2020-08-04 20:34:26 +02:00
parent 4515aa294d
commit e1af19c2fa
2 changed files with 45 additions and 0 deletions

View File

@ -95,6 +95,9 @@ describe("other",function(){
// throughIterator is not used
/**
* @param opsStr
*/
function throughIterator(opsStr) {
var iter = Changeset.opIterator(opsStr);
var assem = Changeset.opAssembler();
@ -105,6 +108,9 @@ describe("other",function(){
}
// throughSmartAssembler is not used
/**
* @param opsStr
*/
function throughSmartAssembler(opsStr) {
var iter = Changeset.opIterator(opsStr);
var assem = Changeset.smartOpAssembler();
@ -119,6 +125,12 @@ describe("other",function(){
/**
* @param testId
* @param cs
* @param lines
* @param correctLines
*/
function testMutateTextLines(testId, cs, lines, correctLines) {
var a = lines.slice();
@ -126,6 +138,14 @@ describe("other",function(){
assertEqualArrays(correctLines, a);
}
/**
* @param testId
* @param cs
* @param lines
* @param alines
* @param pool
* @param correctOutput
*/
function testInverse(testId, cs, lines, alines, pool, correctOutput) {
pool = poolOrArray(pool);
@ -133,12 +153,25 @@ describe("other",function(){
assertEqualStrings(correctOutput, str);
}
/**
* @param testId
* @param cs
* @param filter
* @param correctOutput
*/
function testFilterAttribNumbers(testId, cs, filter, correctOutput) {
var str = Changeset.filterAttribNumbers(cs, filter);
assertEqualStrings(correctOutput, str);
}
/**
* @param testId
* @param attribs
* @param cs
* @param inAttr
* @param outCorrect
*/
function runApplyToAttributionTest(testId, attribs, cs, inAttr, outCorrect) {
var p = poolOrArray(attribs);
var result = Changeset.applyToAttribution(

View File

@ -223,6 +223,10 @@ describe("textLinesMutator",function(){
});
});
/**
* @param origLines
* @param muts
*/
function runMutationTest(origLines, muts) {
var lines1 = origLines.slice();
var mu = Changeset.textLinesMutator(lines1);
@ -238,6 +242,10 @@ function runMutationTest(origLines, muts) {
return [lines1,lines2,outText];
}
/**
* @param mu
* @param arrayOfArrays
*/
function applyMutations(mu, arrayOfArrays) {
arrayOfArrays.forEach(function (a) {
var result = mu[a[0]].apply(mu, a.slice(1));
@ -247,6 +255,10 @@ function applyMutations(mu, arrayOfArrays) {
});
}
/**
* @param oldLen
* @param arrayOfArrays
*/
function mutationsToChangeset(oldLen, arrayOfArrays) {
var assem = Changeset.smartOpAssembler();
var op = Changeset.newOp();