(**************************************************************************
 * 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.
 **************************************************************************)
open Ml2common

(* This was carried over from MP2 (2015). *)
let q5_stu f lst = List.fold_right (Student.split_step f) lst Student.split_base
let q5_sol f lst = List.fold_right (Solution.split_step f) lst Solution.split_base

(* This list is for regular problems *)
let rubric =
[
  (*****************************)
  (***** PROBLEMS FROM MP2 *****)
  (*****************************)

	TEST2ARG_TWOFUN(1, q5_sol, q5_stu, (fun x -> x > 2), [0;2;3;5;1;4]) ;
	TEST1ARG( 1, rle, [1;1;1;2;2;2;3;1;1;1] );
	TEST2ARG( 1, concat, " + ", ["a"; "3"; "z^2"]);
	TEST2ARG( 1, app_all, [(fun x -> x > 0); (fun y -> y mod 2 = 0); (fun x -> x * x = x)], [1; 3; 6]);

  (*****************************)
  (***** PROBLEMS FROM ML2 *****)
  (*****************************)

    (***********************)
    (** Transform PrimOps **)
    (***********************)

  (* This problem will not be given on the MP. *)
  TEST3ARG( 1, consk, 1, [], print_int_list);
  TEST3ARG( 1, concatk, "hello", "world", print_string);
  TEST2ARG( 1, string_of_intk, 1, print_string);
  TEST2ARG( 1, ceilk, 3.14, report_float);

  (* But these will be! *)
  TEST4ARG( 1, add_mul_modk, 3, 3, 3, report_int);

  TEST5ARG( 1, parabolak, 1, 0, 0, 0, (fun x -> x));

  TEST3ARG( 1, keep_the_changek, 3.00, 0.50, report_float);

  TEST4ARG( 1, usernamek, 47, "xx", "HelloKitty", print_string);

    (***********************)
    (*** CPS & Recursion ***)
    (***********************)

  TEST1ARG( 1, even_odd, [-1;0;1]);
  TEST2ARG( 1, even_oddk, [-1;0;1], print_pair_int_list);

  TEST1ARG( 1, enlike, ["totally"; "that's so fetch"]);
  TEST2ARG( 1, enlikek, ["totally"; "that's so fetch"], print_string_list);

  TEST1ARG( 1, low_five, [1;3;5;7;9]);
  TEST2ARG( 1, low_fivek, [1;3;5;7;9], print_int_list);

  TEST2ARG( 1, map, (fun x -> x + 1), [0;1;2]);
  TEST3ARG( 1, mapk, inck, [0;1;2], print_int_list)
]
(* Note: the last entry should not be followed by a semicolon. *)

let extra_rubric = [

  (*****************************)
  (***** PROBLEMS FROM MP2 *****)
  (*****************************)

	TEST2ARG( 1, sub_list, [1;1;2;1;1;4;1], [1;2;1;1;1] );

  TEST7ARG( 1, distributek, inck, inck, addk, 1, 2, 3, report_int);

  TEST3ARG( 1, map_split_pair, (fun x -> x >= 5), (fun x -> x + 1), [2;4;6;8]);
  TEST4ARG( 1, map_split_pairk, (fun x -> geqk x 5), inck, [2;4;6;8], print_pair_int_list);

  TEST3ARG( 1, transform_if, (fun x -> x >= 2), (fun x -> x * 2), [2;4;6;8]);
  TEST4ARG( 1, transform_ifk, (fun x -> geqk x 2), (fun x -> mulk x 2), [2;4;6;8], print_int_list)
]

