Esempio n. 1
0
        public void DiffXIndexTest()
        {
            diff_match_patchTest dmp = new diff_match_patchTest();
              // Translate a location in text1 to text2.
              List<Diff> diffs = new List<Diff> {
              new Diff(Operation.DELETE, "a"),
              new Diff(Operation.INSERT, "1234"),
              new Diff(Operation.EQUAL, "xyz")};
              Assert.AreEqual(5, dmp.DiffXIndex(diffs, 2), "DiffXIndex: Translation on equality.");

              diffs = new List<Diff> {
              new Diff(Operation.EQUAL, "a"),
              new Diff(Operation.DELETE, "1234"),
              new Diff(Operation.EQUAL, "xyz")};
              Assert.AreEqual(1, dmp.DiffXIndex(diffs, 3), "DiffXIndex: Translation on deletion.");
        }