Skip to content

Change line has wrong diff indicators #18

Description

@GoogleCodeExporter
What steps will reproduce the problem?

This JUnit test fails on the 2nd assert:

    public final void testGenerateDiffRowsListOfStringListOfStringChange1() {

        DiffRowGenerator generator = new DiffRowGenerator.Builder().showInlineDiffs(true).ignoreWhiteSpaces(true)
                .columnWidth(100).build();

        List<String> revised = new ArrayList<String>();
        List<String> original = new ArrayList<String>();

        original.add("aaaaa");
        revised.add("aabaa");

        List<DiffRow> result = generator.generateDiffRows(original, revised);

        assertEquals("wrong size", 1, result.size());

        assertEquals("wrong tag", DiffRow.Tag.CHANGE, result.get(0).getTag());
        assertEquals("wrong new value", "aa<span class=\"editNewInline\">b</span>aa", result.get(0).getNewLine());
        assertEquals("wrong old value", "aa<span class=\"editOldInline\">a</span>aa", result.get(0).getOldLine());
    }

What is the expected output? What do you see instead?

junit.framework.ComparisonFailure: wrong old value expected:<aa[<span 
class="editOldInline">a</span>aa]> but was:<aa[aa<span 
class="editOldInline">a</span>]>
    at junit.framework.Assert.assertEquals(Assert.java:81)

Note that the difference for the "old" line indicates the changed part is the 
last "a" and not the middle "a" where it should be.

What version of the product are you using? On what operating system?

Downloaded this file: java-diff-utils-1.2src.zip
Windows XP

Please provide any additional information below.


Original issue reported on code.google.com by LeeMeado...@gmail.com on 2 May 2011 at 2:31

Attachments:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions