Commit ea056205 authored by jkobus's avatar jkobus Committed by Jarek Kobus
Browse files

Ambiguous tests added for differ.



Change-Id: I274e65034534bba5895b586742474b8c0baf4efc
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@digia.com>
parent 4d3a26be
......@@ -600,6 +600,55 @@ void tst_Differ::cleanupSemantics_data()
<< Diff(Diff::Delete, QString("S"))
<< Diff(Diff::Equal, QString("TU"))
<< Diff(Diff::Insert, QString("VW")));
// All ambiguous tests below should return the same result, but they don't.
QTest::newRow("Ambiguous 1")
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W "))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString("Z"))
<< Diff(Diff::Equal, QString("B")))
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W "))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString("Z"))
<< Diff(Diff::Equal, QString("B")));
QTest::newRow("Ambiguous 2")
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W "))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString(" Z"))
<< Diff(Diff::Equal, QString("B")))
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X Y"))
<< Diff(Diff::Insert, QString("W Z"))
<< Diff(Diff::Equal, QString("B")));
QTest::newRow("Ambiguous 3")
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W"))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString(" Z"))
<< Diff(Diff::Equal, QString("B")))
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W"))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString(" Z"))
<< Diff(Diff::Equal, QString("B")));
}
void tst_Differ::cleanupSemantics()
......@@ -690,6 +739,58 @@ void tst_Differ::cleanupSemanticsLossless_data()
<< Diff(Diff::Equal, QString("That "))
<< Diff(Diff::Insert, QString("cat "))
<< Diff(Diff::Equal, QString("cartoon")));
// All ambiguous tests below should return the same result, but they don't.
QTest::newRow("Ambiguous 1")
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W "))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString("Z"))
<< Diff(Diff::Equal, QString("B")))
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W "))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString("Z"))
<< Diff(Diff::Equal, QString("B")));
QTest::newRow("Ambiguous 2")
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W "))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString(" Z"))
<< Diff(Diff::Equal, QString("B")))
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W "))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString(" Z"))
<< Diff(Diff::Equal, QString("B")));
QTest::newRow("Ambiguous 3")
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W"))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString(" Z"))
<< Diff(Diff::Equal, QString("B")))
<< (QList<Diff>()
<< Diff(Diff::Equal, QString("A"))
<< Diff(Diff::Delete, QString("X"))
<< Diff(Diff::Insert, QString("W"))
<< Diff(Diff::Equal, QString(" "))
<< Diff(Diff::Delete, QString("Y"))
<< Diff(Diff::Insert, QString(" Z"))
<< Diff(Diff::Equal, QString("B")));
}
void tst_Differ::cleanupSemanticsLossless()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment