Пример #1
0
        public void DemoDiffOfAdditionToLargeText()
        {
            var text1 = @"I am the very model of a modern Major-General,
I've information vegetable, animal, and mineral,
I know the kings of England, and I quote the fights historical,
From Marathon to Waterloo, in order categorical.

I am the very model of a cartoon individual,
My animation's comical, unusual, and whimsical,
I'm quite adept at funny gags, comedic theory I have read,
From wicked puns and stupid jokes to anvils that drop on your head.";

            var text2 = @"I am the very model of a modern Major-General,
I've information vegetable, animal, and mineral,
I know the kings of England, and I quote the fights historical,
From Marathon to Waterloo, in order categorical.

I am the very model of a cartoon individual,
My animation's comical, unusual, and whimsical,
I'm quite adept at funny gags, comedic theory I have read,
From wicked puns and stupid jokes to anvils that drop on your head.

And that is all I have to say about that.";

            var sut = new DiffMatchPatch();

            sut.DiffTimeout = 0;
            var diffs = sut.DiffMain(text1, text2);

            sut.DiffCleanupEfficiency(diffs);
            var patches = sut.PatchMake(diffs);
            var patch   = sut.PatchToText(patches);

            Approvals.Verify(patch);
        }