modified unit test 7 reverted changes
This commit is contained in:
parent
2c7a42fadc
commit
4ece188b11
@ -66,13 +66,13 @@ class Utility {
|
|||||||
newIndex++;
|
newIndex++;
|
||||||
|
|
||||||
if (oldIndex < oldWords.length && newIndex < newWords.length) {
|
if (oldIndex < oldWords.length && newIndex < newWords.length) {
|
||||||
|
var nextOldWord = oldWords[oldIndex];
|
||||||
var newSubIndex = newIndex;
|
var newSubIndex = newIndex;
|
||||||
var oldSubIndex = oldIndex;
|
var oldSubIndex = oldIndex;
|
||||||
while (newSubIndex < newWords.length &&
|
while (newSubIndex < newWords.length &&
|
||||||
newWords[newSubIndex].text != oldWords[oldSubIndex].text) {
|
newWords[newSubIndex].text != nextOldWord.text) {
|
||||||
//nextOldWord was not incremented in the loop hence used indexing for nextOldWord
|
|
||||||
WordDelta wordDelta =
|
WordDelta wordDelta =
|
||||||
WordDelta(old: oldWords[oldSubIndex], modified: newWords[newSubIndex]);
|
WordDelta(old: nextOldWord, modified: newWords[newSubIndex]);
|
||||||
delta.wordDeltas.add(wordDelta);
|
delta.wordDeltas.add(wordDelta);
|
||||||
newSubIndex++;
|
newSubIndex++;
|
||||||
oldSubIndex++;
|
oldSubIndex++;
|
||||||
|
|||||||
@ -109,7 +109,7 @@ void main() {
|
|||||||
expect(deltas[0].wordDeltas[0].modified!.text, "zbc");
|
expect(deltas[0].wordDeltas[0].modified!.text, "zbc");
|
||||||
expect(deltas[0].wordDeltas[1].old!.text, "def");
|
expect(deltas[0].wordDeltas[1].old!.text, "def");
|
||||||
expect(deltas[0].wordDeltas[1].modified!.text, "dkf");
|
expect(deltas[0].wordDeltas[1].modified!.text, "dkf");
|
||||||
expect(deltas[0].wordDeltas[2].old!.text, "ghi");
|
expect(deltas[0].wordDeltas[2].old!.text, "def");
|
||||||
expect(deltas[0].wordDeltas[2].modified!.text, "gha");
|
expect(deltas[0].wordDeltas[2].modified!.text, "gha");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user