Parcourir la source

Add spying expressions

Leo il y a 8 ans
Parent
commit
91c74d0b61
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 1 1
      src/id_parsing.ml
  2. 3 0
      src/test/id_parsing_t.ml

+ 1 - 1
src/id_parsing.ml

@@ -96,5 +96,5 @@ let list_from_human human =
   (* Return final list of int *)
   (* Return final list of int *)
   |> List.map ~f:(function
   |> List.map ~f:(function
     Unique a -> a | _ -> assert false)
     Unique a -> a | _ -> assert false)
+  |> Tools.spy1_list ~f:Int.to_string
 ;;
 ;;
-

+ 3 - 0
src/test/id_parsing_t.ml

@@ -41,6 +41,9 @@ open Core.Std;;
 (* Function to_human ============================= *)
 (* Function to_human ============================= *)
 let to_human test solution () =
 let to_human test solution () =
   let actual = Id_parsing.list_from_human test in
   let actual = Id_parsing.list_from_human test in
+  (* Spying expression *)
+  List.sexp_of_t Int.sexp_of_t actual |> Sexp.to_string
+  |> printf "actual: %s\n";
   OUnit.assert_equal actual solution
   OUnit.assert_equal actual solution
 ;;
 ;;