use of org.nutz.lang.segment.Segment in project nutz by nutzam.
the class CharSegmentTest method testWrongPPname.
@Test
public void testWrongPPname() {
Segment seg = Segments.create("H${4}B");
seg.set("RVT", "zzh");
assertEquals("HB", seg.toString());
seg.set("4", "zzh");
assertEquals("HzzhB", seg.toString());
assertEquals(1, seg.keys().size());
assertEquals(3, seg.values().size());
}
use of org.nutz.lang.segment.Segment in project nutz by nutzam.
the class CharSegmentTest method testAddPP2.
@Test
public void testAddPP2() {
Segment seg = Segments.create("-${A}-${B}-");
seg.add("A", "A");
seg.add("A", "B");
seg.add("A", "C");
seg.add("B", "H");
seg.add("B", "M");
assertEquals("-ABC-HM-", seg.toString());
seg.set("B", "ZZH");
assertEquals("-ABC-ZZH-", seg.toString());
}
use of org.nutz.lang.segment.Segment in project nutz by nutzam.
the class CharSegmentTest method testChineseChar.
@Test
public void testChineseChar() {
String s = new StringBuilder().append((char) Integer.parseInt("6211", 16)).toString();
Segment seg = Segments.create(s);
assertTrue(s.equals(seg.toString()));
}
use of org.nutz.lang.segment.Segment in project nutz by nutzam.
the class CharSegmentTest method testEscapeChar3.
@Test
public void testEscapeChar3() {
Segment seg = Segments.create("H$$$$4}B");
assertEquals("H$$4}B", seg.toString());
}
use of org.nutz.lang.segment.Segment in project nutz by nutzam.
the class CharSegmentTest method test_blankKeys.
public void test_blankKeys() {
Segment seg = Segments.create("1${A}2${B}3${C}4${D}5");
// assertEquals(4, seg.blankKeys().size());
seg.set("A", 34);
seg.set("D", "GG");
// assertEquals(2, seg.blankKeys().size());
}
Aggregations