Commits

camlspotter committed b75f48e

reorganization of dcamltests

  • Participants
  • Parent commits 46798a6
  • Branches gcaml

Comments (0)

Files changed (5)

File dcamltests/auto-test.pl

   elsif( $? == 512 ){ $result = "ERROR: $result"; }
   elsif( $? != 0 ){ $result = "$?!!!"; }
   else { $result = "OK"; }
-  if( $file =~ /^error_/ && $result =~ /^ERROR/ ){
+  if( $file =~ /error/ && $result =~ /^ERROR/ ){
       $result = "OK (error)";
   }
   print "$file:\t$result\n";

File dcamltests/error_multi.ml

-(* multiple candidates *)
-module Sum : sig
-  type 'a t
-  val sum : $:'a t -> 'a -> int
-  val int : int t
-  val int' : int t
-  val list : $:'a t -> 'a list t
-end = struct
-  type 'a t = 'a -> int
-  let sum $:d = d
-  let int x = x
-  let int' x = x + 1
-  let rec list = function
-    | [] -> 0
-    | x::xs -> sum x + list (* it should be sum *) xs
-end
-  
-let _ =
-  assert (Sum.sum 1 = 1);
-;;

File dcamltests/multi_error.ml

+(* multiple candidates *)
+module Sum : sig
+  type 'a t
+  val sum : $:'a t -> 'a -> int
+  val int : int t
+  val int' : int t
+  val list : $:'a t -> 'a list t
+end = struct
+  type 'a t = 'a -> int
+  let sum $:d = d
+  let int x = x
+  let int' x = x + 1
+  let rec list = function
+    | [] -> 0
+    | x::xs -> sum x + list (* it should be sum *) xs
+end
+  
+let _ =
+  assert (Sum.sum 1 = 1);
+;;

File dcamltests/rec.ml

 let f $x = x
-let rec g = f
+let rec g $:a = f $:a
+(* let rec g = f should fail, since it is not equivalent with the
+   above *)
 let rec h x = f x
 
 let rec i = fun $x y -> f $x y :: i $x y 

File dcamltests/rec_error.ml

+let f $x = x
+let rec g = f (* fails *)
+  (* this should not be translated to 
+     let rec g $:x = f $:x
+  *)