new MuAlternation(new MuSequence(new MuArgument("intArg"), new MuBackReference("root")),
new MuArgument("bigArg")));
syntax.resolveBackReferences();
MuParser parser = new MuParser();
CommandLine cl;
cl = new CommandLine(new String[] {"BIG"});
parser.parse(syntax, null, cl.tokenIterator(), bundle);
Assert.assertEquals(1, bigArg.getValues().length);
Assert.assertEquals(0, smallArg.getValues().length);
Assert.assertEquals(0, intArg.getValues().length);
cl = new CommandLine(new String[] {"1", "LARGE"});
parser.parse(syntax, null, cl.tokenIterator(), bundle);
Assert.assertEquals(1, bigArg.getValues().length);
Assert.assertEquals(0, smallArg.getValues().length);
Assert.assertEquals(1, intArg.getValues().length);
cl = new CommandLine(new String[] {"1", "2", "BIG"});
parser.parse(syntax, null, cl.tokenIterator(), bundle);
Assert.assertEquals(1, bigArg.getValues().length);
Assert.assertEquals(0, smallArg.getValues().length);
Assert.assertEquals(2, intArg.getValues().length);
cl = new CommandLine(new String[] {"1", "2", "3", "BIG", "SMALL"});
parser.parse(syntax, null, cl.tokenIterator(), bundle);
Assert.assertEquals(1, bigArg.getValues().length);
Assert.assertEquals(1, smallArg.getValues().length);
Assert.assertEquals(3, intArg.getValues().length);
try {
cl = new CommandLine(new String[] {"1", "2", "TINY"});
parser.parse(syntax, null, cl.tokenIterator(), bundle);
Assert.fail("expected SEE");
} catch (CommandSyntaxException ex) {
// expected
}
}