Skip to content

LcsString diff0 method does not correctly create a valid diff in all cases (doesn't show correct number of matches) #15

@CodesAway

Description

@CodesAway

LcsString diff0 method does not correctly create a valid diff in all cases (doesn't show correct number of matches)

		// diff0 has 0 matching characters, yet should be the same number as LCS
		// (this is yielding an invalid diff)
		LcsString lcsString = new LcsString("warningmsg", "naming");
		//		LcsString lcsString = new LcsString("naming", "warningmsg");

		System.out.println("LCS: " + lcsString.lcsLength());
		System.out.println(
				"diff match: " + lcsString.diff().stream().filter(d -> d.getType() == LcsDiffType.NONE).count());
		System.out.println(
				"diff0 match: " + lcsString.diff0().stream().filter(d -> d.getType() == LcsDiffType.NONE).count());

		System.out.println("diff()");
		lcsString.diff().forEach(System.out::println);
		System.out.println();

		System.out.println("diff0()");
		lcsString.diff0().forEach(System.out::println);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions