예제 #1
0
 @Test
 public void testTokenizerNesting() {
   CurlyBraceTokenizer tok = new CurlyBraceTokenizer("foo{bar{baz}}blah");
   assertEquals("foo", tok.next());
   assertEquals("{bar{baz}}", tok.next());
   assertEquals("blah", tok.next());
   assertFalse(tok.hasNext());
 }
예제 #2
0
 @Test
 public void testTokenizerNoClosing() {
   CurlyBraceTokenizer tok = new CurlyBraceTokenizer("foo{bar}baz{blah");
   assertEquals("foo", tok.next());
   assertEquals("{bar}", tok.next());
   assertEquals("baz", tok.next());
   assertEquals("{blah", tok.next());
   assertFalse(tok.hasNext());
 }
예제 #3
0
 @Test
 public void testTokenizerNoOpening() {
   CurlyBraceTokenizer tok = new CurlyBraceTokenizer("foo}bar}baz");
   assertEquals("foo}bar}baz", tok.next());
   assertFalse(tok.hasNext());
 }
예제 #4
0
 @Test
 public void testTokenizerNoBraces() {
   CurlyBraceTokenizer tok = new CurlyBraceTokenizer("nobraces");
   assertEquals("nobraces", tok.next());
   assertFalse(tok.hasNext());
 }