private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_ALL;
public void testEqualsWithoutWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size());
}
public void testEqualsWithWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\na \n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\n"));
// "foo-a" != "foo-a b"
private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_LEADING;
public void testEqualsWithoutWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size());
}
public void testEqualsWithWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\n a\nb \n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\nb\n"));
// "foo-a" != "foo-a b"
private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_TRAILING;
public void testEqualsWithoutWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size());
}
public void testEqualsWithWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\na \n b\n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\nb\n"));
// "foo-a" != "foo-a b"
private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_CHANGE;
public void testEqualsWithoutWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size());
}
public void testEqualsWithWhitespace() {
- final RawText a = new RawText(cmp, Constants
+ final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\na \n foo\na b c\n"));
- final RawText b = new RawText(cmp, Constants
+ final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\nfoo\na b c \n"));
// "foo-a" != "foo-a b"
* through cached arrays is safe.
*/
public RawText(final byte[] input) {
- this(RawTextComparator.DEFAULT, input);
- }
-
- /**
- * Create a new sequence from an existing content byte array.
- *
- * The entire array (indexes 0 through length-1) is used as the content.
- *
- * @param cmp
- * comparator that will later be used to compare texts.
- * @param input
- * the content array. The array is never modified, so passing
- * through cached arrays is safe.
- */
- public RawText(RawTextComparator cmp, byte[] input) {
content = input;
lines = RawParseUtils.lineMap(content, 0, content.length);
}