let rubric_version = "1.0"
let rubric_title = "CS421 Spring 2007 MP7"

(**************************************************************************
 * You can add new test cases by adding new elements to the following lists
 * Format is:
 * TEST<X>ARG(<weight>, <function_name>, <arg1>, <arg2>, ..., <argX>)
 *
 * <X> is the number of argument that the function being tested takes.
 **************************************************************************)

(* Test cases should go in this list. 
 * The first element of the pair is the weight of the case,
 * and the second is the string to be given to the parser.
 *)

let try_get_all_tokens s =
    try Some (Solution.get_all_tokens s) with Failure "unmatched comment" -> None
let try_get_all_tokens_stu s =
    try Some (Student.get_all_tokens s) with Failure "unmatched comment" -> None

let fail_get_all_tokens s = Util.timer 4 (fun () -> Solution.get_all_tokens s)
let fail_get_all_tokens_stu s = Util.timer 4 (fun () -> Student.get_all_tokens s)

(* This list is for regular problems *)
let rubric = [
  (* Problem 1 *)
  TEST1ARG(1, get_all_tokens, "abstract");
  TEST1ARG(1, get_all_tokens, "class const () < << *=");
  TEST1ARG(1, get_all_tokens, "|| | || && finally < << <<= >>>=");

  (* Problem 2 *)
  TEST1ARG(1, get_all_tokens, "4");
  TEST1ARG(1, get_all_tokens, "3428");
  TEST1ARG(1, get_all_tokens, "4 3 343 232");

  (* Problem 3 *)
  TEST1ARG(1, get_all_tokens, "343.4");
  TEST1ARG(1, get_all_tokens, ".2 3.4 8.1");
  TEST1ARG(1, get_all_tokens, "1.9 2.8e34 3.1e-21 12.2 .4 321.");

  (* Problem 4 *)
  TEST1ARG(1, get_all_tokens, "true");
  TEST1ARG(1, get_all_tokens, "false true false true");

  (* Problem 5 *)
  TEST1ARG(1, get_all_tokens, "monkeys dogs fish birds cats");
  TEST1ARG(1, get_all_tokens, "case abstract monkeys");
  TEST1ARG(1, get_all_tokens, "ident1 2newident");

  (* Problem 6 *)
  TEST1ARG(1, get_all_tokens, "/* hello */");
  TEST1ARG(1, get_all_tokens, "/* what up */   */");
  TEST1ARG(1, get_all_tokens, "case // this is a line comment");

  (* Problem 7 *)
  TEST1ARG(1, get_all_tokens, "\"hey there\"");
  TEST1ARG(1, get_all_tokens, "\"what's up?\"");

  (* mixed *)
  TEST1ARG(1, get_all_tokens, "public void abstract (int x, int y);");
  TEST1ARG(1, get_all_tokens, "hey there case 3.4 <<=");
  TEST1ARG(1, get_all_tokens, "(2 + 4) * 8 - 9 * \"some number 13\"");

  (* 4 unit students *)
  TEST1ARG(0, get_all_tokens, " hello (* some comment *) there ");
  TEST1ARG(0, get_all_tokens, " (* hiya (* what is up *) (* my friend *) (* (* *) *) *) steve");
  TEST1ARG(0, get_all_tokens, " (* *) *) ")
]

let extra_rubric = []
