Source

ocaml-bert / tests_bert.ml

Diff from to

tests_bert.ml

     run_tests suite 0;;
 
 let rec decoding_test answers problem results=
-  match answers, (Bert.decode_binary problem) with
-    | [], _ -> results;
-    | hd::tl, Bert.Ok( term, remain )->
-	print_endline "!!!";
-	Bert.print_binary_string problem;
-	Bert.print_erlterm term;
-	begin if term = hd then
-	  decoding_test tl remain (results+1)
-	else 
-	  raise Test_failure
-	end;
-    | _ ->
-	raise Test_failure;;
+  match answers with
+    | [] -> 
+	results;
+    | hd::tl ->
+	match (Bert.decode_binary problem) with 
+	  | Bert.Ok( term, remain )->
+	      if term = hd then decoding_test tl remain (results+1)
+	      else raise Test_failure;
+	  | _ ->
+	      raise Test_failure;;
 
 let rec encode_all list str ofs =
   match list with
 	       Bert.String("HAHAHA"); Bert.Binary("HAHAHA") ] in
   let str = String.create 128 in
   let _ = encode_all list str 0 in
-    Bert.print_binary_string str;
     decoding_test list str 0 ;;
 (*    print_endline str; 
   raise Test_failure;; *)