let rubric_version = "1.0"
let rubric_title = "CS421 Summer 2009 MP4"

(**************************************************************************
 * 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, "class const () < << *=");

  (* Problem 2 *)
  TEST1ARG(1, get_all_tokens, "1 2 345 6789");

  (* Problem 3 *)
  TEST1ARG(1, get_all_tokens, "1.0 .2 3.4 5.0e6");

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

  (* Problem 5 *)
  TEST1ARG(1, get_all_tokens, "case abstract monkeys cats1 dogs2");

  (* Problem 6 *)
  TEST1ARG(1, get_all_tokens, "/* hello // world */");

  (* Problem 7 *)
  TEST1ARG(1, get_all_tokens, "\"hey there\"");

  (* mixed *)
  TEST1ARG(1, get_all_tokens, "public void foo(int x, int y) { x = y * \"hello\"; };")
]

let extra_rubric = [
  (* Problem 8 *)
  TEST1ARG(1, get_all_tokens, " x = y + (* hello (* some comment *) there *) 1;")
]
