Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

finished writing board tests

  • Loading branch information...
commit f307c603d94dfbaf00824d75680bd538ac3896a3 1 parent 5fd5327
bluebandedgobi authored
Showing with 14 additions and 5 deletions.
  1. +3 −3 Makefile
  2. +8 −0 boardstuffs.ml
  3. +1 −0  main.ml
  4. +2 −2 testGetThreats.ml
6 Makefile
View
@@ -11,7 +11,7 @@ CAMLDOC = ocamldoc
TESTFILES = \
boardstuffs.ml \
boardcomp.ml \
- board.ml
+ board.ml
FILES = \
event.ml \
@@ -33,8 +33,8 @@ all: clean run_basic
tests: clean run_tests
-$(PROG)_tests: $(OBJECTS) testGetThreats.cmo
- $(CAMLC) $(CAMLFLAGS) $(LIBS) $(TESTOBJECTS) testGetThreats.cmo -o $(PROG)_tests
+$(PROG)_tests: $(OBJECTS) testGetThreats.cmo testInsert.cmo testBoardFuncs.cmo
+ $(CAMLC) $(CAMLFLAGS) $(LIBS) $(TESTOBJECTS) testGetThreats.cmo testInsert.cmo testBoardFuncs.cmo -o $(PROG)_tests
build_tests: $(PROG)_tests
8 boardstuffs.ml
View
@@ -66,6 +66,14 @@ let rec print_index_list il = match il with
print_string "; ";
print_index_list tl
+let print_tuple t = let (x,y) = t in
+ print_string "(";
+ print_int x;
+ print_string ", ";
+ print_int y;
+ print_string ") ";
+ flush_all ()
+
(** Sorts a list of tuples **)
let tuple_sort (lst: index list) =
List.sort (fun (x1,y1) (x2,y2) -> y1 - y2) lst
1  main.ml
View
@@ -236,6 +236,7 @@ let test_board () =
draw_board ();
debug_board ();
Myboard.indices newbor;
+ print_tuple (Myboard.getNeighbors newbor);
newbor
(*draw_board ();
newbor
4 testGetThreats.ml
View
@@ -564,6 +564,6 @@ let _ = run_tests_horizontal ();
run_tests_vertical ();
run_tests_diagright ();
run_tests_diagleft ();
- print_string "\nSuccessfully passed: ";
+ print_string "\ngetThreats successfully passed: ";
print_int !successful;
- print_string " tests.\n\n";
+ print_string "/104 tests.\n\n";
Please sign in to comment.
Something went wrong with that request. Please try again.