/**
  * Tests the pattern left-recursive detection.
  */
 public void TestLeftRecursive()
 {
     pattern = new ProductionPattern(P1, "P1");
     alt     = new ProductionPatternAlternative();
     alt.AddProduction(P2, 0, -1);
     alt.AddToken(T1, 0, 1);
     alt.AddProduction(P1, 0, 1);
     alt.AddToken(T2, 1, 1);
     AddAlternative(pattern, alt);
     AssertTrue(pattern.IsLeftRecursive());
 }