### Eclipse Workspace Patch 1.0 #P org.eclipse.compare.tests Index: src/org/eclipse/compare/tests/DocLineComparatorTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java,v retrieving revision 1.4 diff -u -r1.4 DocLineComparatorTest.java --- src/org/eclipse/compare/tests/DocLineComparatorTest.java 16 Mar 2007 20:25:10 -0000 1.4 +++ src/org/eclipse/compare/tests/DocLineComparatorTest.java 24 Dec 2008 11:47:08 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,6 +17,7 @@ import org.eclipse.compare.rangedifferencer.IRangeComparator; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.Region; public class DocLineComparatorTest extends TestCase { @@ -70,4 +71,15 @@ Assert.assertTrue(comp1.rangesEqual(0, comp2, 0)); } + + public void testBug259422() { + IDocument doc= new Document(); + doc.set(""); //$NON-NLS-1$ + + IRangeComparator comp1= new DocLineComparator(doc, null, true); + IRangeComparator comp2= new DocLineComparator(doc, new Region(0, doc.getLength()), true); + + Assert.assertTrue(comp1.rangesEqual(0, comp2, 0)); + + } }