Commit 2a0680c2 authored by dreis2211's avatar dreis2211 Committed by Stephane Nicoll

Fix StringSequence.equals() for different lengths

See gh-15465
parent 64c6b9c6
......@@ -126,7 +126,7 @@ final class StringSequence implements CharSequence {
}
return true;
}
return true;
return false;
}
@Override
......
......@@ -167,6 +167,13 @@ public class StringSequenceTests {
assertThat(a).isEqualTo(b).isNotEqualTo(c);
}
@Test
public void notEqualsWhenSequencesOfDifferentLength() {
StringSequence a = new StringSequence("abcd");
StringSequence b = new StringSequence("ef");
assertThat(a).isNotEqualTo(b);
}
@Test
public void startsWithWhenExactMatch() {
assertThat(new StringSequence("abc").startsWith("abc")).isTrue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment