public void testComplexToken()
throws Exception
{
String x = "< style >x";
pattern a =
new pattern(new node[]
{
new node(Constants.BEGIN), new node(Constants.NUMTOKEN),
new node(Constants.END), new node(Constants.NUMTOKEN)
}
);
pattern b =
new pattern(new node[]
{
new node(Constants.BEGIN), new node(Constants.STYLE),
new node(Constants.END), new node(Constants.NUMTOKEN)
}
);
pattern c =
new pattern(new node[]
{
new node(Constants.BEGIN), new node(Constants.WS, true),
new node(Constants.STYLE), new node(Constants.WS, true),
new node(Constants.END), new node(Constants.NUMTOKEN)
}
);
pattern d =
new pattern(new node[]
{
new node(Constants.BEGIN), new node(Constants.WS, true),
new node(Constants.STYLE), new node(Constants.WS, true),
new node(Constants.END), new node(Constants.BEGIN)
}
);
ReaderTokenizer rt = new ReaderTokenizer();
rt.reset(new StringReader(x));
assertFalse(a.matches(rt));
assertFalse(b.matches(rt));
assertTrue(c.matches(rt));
assertFalse(d.matches(rt));
}