package ch.poole.openinghoursparser;

import java.io.ByteArrayInputStream;
import java.util.List;
import java.util.Scanner;

/**
 * Individual testing for the OpeningHoursParser, receiving
 * inputs from System.in
 * 
 * 
 * @author Vuong Ho
 *
 */

public class IndividualTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in); 
        Boolean isStrict = args[0].equals("true");
        while(true) {
            System.out.print("Please enter your input: ");
            String input = sc.nextLine();
            try {
                OpeningHoursParser parser = new OpeningHoursParser(new ByteArrayInputStream(input.getBytes()));
                List<ch.poole.openinghoursparser.Rule> rules = parser.rules(isStrict);
                System.out.println("Legal input string");
                System.out.println("Detected rules in input string listed below");
                for(ch.poole.openinghoursparser.Rule rule : rules) {
                    System.out.println(rule.toDebugString());
                }
                System.out.println("\n------------------------------\n");
            } catch (OpeningHoursParseException e) {
                System.out.println("Illegal input string");
                e.printStackTrace();
                System.out.println("\n------------------------------\n");
            }
        }
    }
}
@@ -181,19 +181,16 @@
 eceiving
-%0A *
  inputs 
@@ -204,16 +204,16 @@
 stem.in%0A
+
  * %0A * %0A
@@ -239,17 +239,16 @@
 %0A *%0A */%0A
-%0A
 public c
@@ -358,17 +358,16 @@
 tem.in);
- 
 %0A       
@@ -406,24 +406,121 @@
 ls(%22true%22);%0A
+        System.out.println(%22Parse strings in opening-hours format, empty input will terminate%22);%0A
         whil
@@ -520,16 +520,17 @@
    while
+ 
 (true) %7B
@@ -627,24 +627,97 @@
 nextLine();%0A
+            if (%22%22.equals(input)) %7B%0A                break;%0A            %7D%0A
             
@@ -1058,24 +1058,98 @@
 ed below%22);%0A
+                System.out.println(%22%5Cn------------------------------%5Cn%22);%0A
             
@@ -1155,16 +1155,17 @@
      for
+ 
 (ch.pool

Allow empty input to terminate testing