Exemplo n.º 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());
 }
Exemplo n.º 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());
 }
Exemplo n.º 3
0
 @Test
 public void testTokenizerNoOpening() {
   CurlyBraceTokenizer tok = new CurlyBraceTokenizer("foo}bar}baz");
   assertEquals("foo}bar}baz", tok.next());
   assertFalse(tok.hasNext());
 }
Exemplo n.º 4
0
 @Test
 public void testTokenizerNoBraces() {
   CurlyBraceTokenizer tok = new CurlyBraceTokenizer("nobraces");
   assertEquals("nobraces", tok.next());
   assertFalse(tok.hasNext());
 }