package hirondelle.web4j.ui.translate;

import java.util.regex.*;

import junit.framework.*;

public final class TESTTranslateTextFlow extends TestCase {

  public static void main(String args[]) {
    String[] testCaseName = {TESTTranslateTextFlow.class.getName()};
    junit.textui.TestRunner.main(testCaseName);
  }

  public TESTTranslateTextFlow(String aName) {
    super(aName);
  }

  // TEST CASES //
  
  public void testMatches(){
    showGroups("1Yes");
    showGroups(" 2Yes  ");
    showGroups("3Yes ");
    showGroups(" 4Yes");
    showGroups("  5Yes  ");
    showGroups("  Yes No Maybe  ");
  }

  // FIXTURE //

  protected void setUp() {
  }

  protected void tearDown() {
  }

  // PRIVATE //
  
  private void showGroups(String aInput){
    Matcher matcher = TextFlow.TRIMMED_TEXT.matcher(aInput);
    while ( matcher.find() ){ 
      for (int idx=0; idx <= matcher.groupCount(); ++idx) {
        //System.out.println("Group " + idx + ": \"" + matcher.group(idx) + "\"");
      }
    }
  }
  

}
