Lines Matching full:segment
27 StringSegment segment(SAMPLE_STRING, false); in testOffset() local
28 assertEquals("Initial Offset", 0, segment.getOffset()); in testOffset()
29 segment.adjustOffset(3); in testOffset()
30 assertEquals("Adjust A", 3, segment.getOffset()); in testOffset()
31 segment.adjustOffset(2); in testOffset()
32 assertEquals("Adjust B", 5, segment.getOffset()); in testOffset()
33 segment.setOffset(4); in testOffset()
34 assertEquals("Set Offset", 4, segment.getOffset()); in testOffset()
38 StringSegment segment(SAMPLE_STRING, false); in testLength() local
39 assertEquals("Initial length", 11, segment.length()); in testLength()
40 segment.adjustOffset(3); in testLength()
41 assertEquals("Adjust", 8, segment.length()); in testLength()
42 segment.setLength(4); in testLength()
43 assertEquals("Set Length", 4, segment.length()); in testLength()
44 segment.setOffset(5); in testLength()
45 assertEquals("After adjust offset", 2, segment.length()); in testLength()
46 segment.resetLength(); in testLength()
47 assertEquals("After reset length", 6, segment.length()); in testLength()
51 StringSegment segment(SAMPLE_STRING, false); in testCharAt() local
52 assertEquals("Initial", SAMPLE_STRING, segment.toUnicodeString()); in testCharAt()
53 assertEquals("Initial", SAMPLE_STRING, segment.toTempUnicodeString()); in testCharAt()
54 segment.adjustOffset(3); in testCharAt()
55 assertEquals("After adjust-offset", UnicodeString(u"radio "), segment.toUnicodeString()); in testCharAt()
56 assertEquals("After adjust-offset", UnicodeString(u"radio "), segment.toTempUnicodeString()); in testCharAt()
57 segment.setLength(5); in testCharAt()
58 assertEquals("After adjust-length", UnicodeString(u"radio"), segment.toUnicodeString()); in testCharAt()
59 assertEquals("After adjust-length", UnicodeString(u"radio"), segment.toTempUnicodeString()); in testCharAt()
63 StringSegment segment(SAMPLE_STRING, false); in testGetCodePoint() local
64 assertEquals("Double-width code point", 0x1F4FB, segment.getCodePoint()); in testGetCodePoint()
65 segment.setLength(1); in testGetCodePoint()
66 assertEquals("Inalid A", -1, segment.getCodePoint()); in testGetCodePoint()
67 segment.resetLength(); in testGetCodePoint()
68 segment.adjustOffset(1); in testGetCodePoint()
69 assertEquals("Invalid B", -1, segment.getCodePoint()); in testGetCodePoint()
70 segment.adjustOffset(1); in testGetCodePoint()
71 assertEquals("Valid again", 0x20, segment.getCodePoint()); in testGetCodePoint()
75 StringSegment segment(SAMPLE_STRING, false); in testCommonPrefixLength() local
76 assertEquals("", 11, segment.getCommonPrefixLength(SAMPLE_STRING)); in testCommonPrefixLength()
77 assertEquals("", 4, segment.getCommonPrefixLength(u" r")); in testCommonPrefixLength()
78 assertEquals("", 3, segment.getCommonPrefixLength(u" x")); in testCommonPrefixLength()
79 assertEquals("", 0, segment.getCommonPrefixLength(u"x")); in testCommonPrefixLength()
80 segment.adjustOffset(3); in testCommonPrefixLength()
81 assertEquals("", 0, segment.getCommonPrefixLength(u"RADiO")); in testCommonPrefixLength()
82 assertEquals("", 5, segment.getCommonPrefixLength(u"radio")); in testCommonPrefixLength()
83 assertEquals("", 2, segment.getCommonPrefixLength(u"rafio")); in testCommonPrefixLength()
84 assertEquals("", 0, segment.getCommonPrefixLength(u"fadio")); in testCommonPrefixLength()
85 segment.setLength(3); in testCommonPrefixLength()
86 assertEquals("", 3, segment.getCommonPrefixLength(u"radio")); in testCommonPrefixLength()
87 assertEquals("", 2, segment.getCommonPrefixLength(u"rafio")); in testCommonPrefixLength()
88 assertEquals("", 0, segment.getCommonPrefixLength(u"fadio")); in testCommonPrefixLength()
89 segment.resetLength(); in testCommonPrefixLength()
90 segment.setOffset(11); // end of string in testCommonPrefixLength()
91 assertEquals("", 0, segment.getCommonPrefixLength(u"foo")); in testCommonPrefixLength()