camlspotter avatar camlspotter committed c55edf6

updated tests. now coverage = 50%

Comments (0)

Files changed (23)

 
   and find_ident (str : Value.structure) (kind, name, pos) : Value.z =
     let name_filter = fun (id, (k,_)) -> 
-      Format.eprintf "DEBUG: %s %s ? %s %s@."
+      Debug.format "DEBUG: %s %s ? %s %s@."
         (Kind.to_string kind)
         name 
         (Kind.to_string k)
           !!(module_expr (Env.override env (id, (Kind.Module, v2)))
                None(*?*) mexp)
         in
-        Format.eprintf "closure app: %a@." Value.Format.t v;
+        Debug.format "closure app: %a@." Value.Format.t v;
         v
     end
 end

tests/applied_sig.ml

 module M(A : sig type t end) = struct
   let _ = prerr_endline "M(A)"
-  (* M(A).S => *)
-  module type S = sig
+  module type (* M(A).S => *) S   (* <= M(A).S *) = sig
     type t = A.t list
   end
-  (* <= M(A).S *)
+
 end
 
 module A = struct type t = int end

tests/capital_idents.ml

 let z = 1
 
-type (* constr E => *) t = E (* <= constr E *)
+type t = (* constr E => *) E (* <= constr E *)
 
-(* module E => *) module E = struct let (* E.x => *) x (* <= E.x *) = 1 end (* <= module E *) 
+module (* module E => *) E (* <= module E *) = struct let (* E.x => *) x (* <= E.x *) = 1 end 
 
-(* modtype E => *) module type E = sig val x : int end (* <= modtype E *) 
+module type (* modtype E => *) E (* <= modtype E *) = sig val x : int end 
 
 let _ = E (* ? constr E *)
 
-(* exception E => *) exception E (* <= exception E *)
+exception (* exception E => *) E (* <= exception E *)
 
 let _ = raise E (* ? exception E *)
 
 let _ = E.x (* ? E.x *)
 
-(* module M => *)
-module M : E (* ? modtype E *) = struct
+module (* module M => *) M (* <= module M *): E (* ? modtype E *) = struct
   let x = 1
 end
-(* <= module M *)
+

tests/exception.ml

-(* E => *) exception E (* <= E *)
+exception (* E => *) E (* <= E *)
 let _ = raise E (* ? E *)
 
 let _ = try raise E (* ? E *) with
 exception X = E (* ? E *) (* bug 090818 *)
 
 module M = struct
-  (* EE => *) exception EE (* <= EE *)
+  exception (* EE => *) EE (* <= EE *)
 end
 
 let _ = raise M.EE (* ? EE *)

tests/fstclassmodule.ml

-(* S => *)
-module type S = sig
+module type (* S => *) S (* <= S *) = sig
   type t
   val x : t list
 end
-(* <= S *)
 
-(* M => *)
-module M : S (* ? S *) with type t = int = struct
+
+module (* M => *)M(* <= M *) : S (* ? S *) with type t = int = struct
   type t = int
   let x = [1]
 end
-(* <= M *)
+
 
 let (* m => *) m (* <= m *) = (module M (* ? M *) : S (* ? S *) with type t = int)
 module M' = (val m (* ? m *) : S (* ? S *) with type t = int)

tests/functor_app.ml

+module M = struct
+  let (* M.bar => *) bar (* <= M.bar *) = 42
+end
+
+module F(S : sig val bar : int end) = struct
+  include S
+end
+
+module N = F(M)
+
+let _ = N.bar (* ? M.bar *) 

tests/functor_call.ml

+module M = struct
+  let bar = 342
+end
+
+module (* F => *) F (* <= F *) (S : sig val bar : int end) = struct
+  include S
+  let bar2 = S.bar
+  let _ = bar2
+  let _ = bar
+end
+
+module N = F (* ? F *)(M)

tests/functor_expansion.ml

+module F (S : sig val bar : int end) = struct
+  include S
+  let (* F.bar2 => *) bar2 (* <= F.bar2 *) = 
+    S.bar 
+  let _ = bar2 (* ? F.bar2 *)
+end

tests/include_functor_app.ml

-(* F => *)
-module F(A : sig end) = struct
+module (* F => *)F(* <= F *)(A : sig end) = struct
   let (* x => *) x (* <= x *) = 1
 end
-(* <= F *)
+
 
 module M = struct
   include F (* ? F *) (struct end)

tests/module_alias.ml

-(* M0 => *)
-module M0 = struct
+module (* M0 => *) M0 (* <= M0 *) = struct
 end
-(* <= M0 *)
+
 
 module M1 = M0 (* ? M0 *) 
 

tests/module_and_modtype.ml

 module O = struct
   module M = struct end
-  (* O.M => *) module type M = sig end (* <= O.M *) 
+  module type (* O.M => *) M (* <= O.M *) = sig end 
 end
 
 module N : O.M (* ? O.M *) = struct end

tests/module_type.ml

-(* SX => *)
-module type SX = sig
-  type (* SX.t => *) t = int (* <= SX.t *)
+module type (* SX => *) SX (* <= SX *) = sig
+  type (* SX.t => *) t (* <= SX.t *) = int 
 end
-(* <= SX *)
 
 module type S = sig
   module X : SX (* ? SX *)

tests/module_use.ml

-(* F => *) module F (A : sig end) = struct end (* <= F *) 
+module (* F => *) F (* <= F *) (A : sig end) = struct end 
 
-(* N => *) module N = struct end (* <= N *)
+module (* N => *) N (* <= N *) = struct end 
 
 module M = F (* ? F *) (N (* ? N *))
-(* M => *) module M = struct
+module (* M => *) M (* <= M *) = struct
   let (* x => *) x (* <= x *) = 1
-end (* <= M *)
+end 
 
 open M (* ? M *)
 open Target (* ? Target *)

tests/recmodule.ml

-module rec M : sig val f : unit -> unit end = (* M => *) struct
+module rec (* M => *) M (* <= M *) : sig val f : unit -> unit end = struct
 
   include N (* ? N *)
 
   let (* M.f => *) f (* <= M.f *) () = N.g (* ? N.g *) ()
 
-end (* <= M *) and N : sig val g : unit -> unit end = (* N => *) struct
+end and (* N => *) N (* <= N *) : sig val g : unit -> unit end = struct
 
   include M (* ? M *) 
 
   let (* N.g => *) g (* <= N.g *) () = M.f (* ? M.f *) ()
 
-end (* <= N *)
+end 

tests/signature.ml

 module type T = sig
-  module M : sig type (* M.t => *) t = int (* <= M.t *) end
+  module M : sig type (* M.t => *) t (* <= M.t *) = int end
   val f : M.t (* ? M.t *)
 end
 
   type (* t => *) t (* <= t *)
 end
 
-(* N => *)
-module N = struct
+module (* N => *) N (* <= N *) = struct
 end
-(* <= N *)
+
 
 module O = N
 
-type fnt = F(N(* ? N *)).t (* ? t *)
+type fnt = F( N(* ? N *)  ).t (* ? t *)
-type (* type t => *) t = Foo | Bar of int (* <= type t *)
+type (* type t => *) t (* <= type t *) = Foo | Bar of int 
 
 let _ = Foo (* ? type t *)
 let _ = Bar (* ? type t *) 1
 
 type u = A of v (* ? type v *)
-and (* type v => *) v = B of u | C (* <= type v *)
+and (* type v => *) v (* <= type v *) = B of u | C 
 
 let _ = A C (* ? type v *)
 let _ = B (* ? type v *) (A C)
 
-type (* type x => *) x = { y : int } (* <= type x *)
+type (* type x => *) x (* <= type x *) = { y : int } 
 
 let (* x => *) x (* <= x *) = { y = 1 } (* ? type x *)
 
 (* <= type tt *)
 
 type 'a uu = Foo of 'a vv (* ? type vv *)
-and (* type vv => *) 'a vv = Bar of 'a uu (* <= type vv *)
+and 'a (* type vv => *) vv (* <= type vv *) = Bar of 'a uu 
 
 module M = struct
-  type (* type typ => *) typ = F (* <= type typ *)
+  type (* type typ => *) typ (* <= type typ *) = F 
   let (* value typ => *) typ (* <= value typ *) = 1
 end
 
 type u = Test15.w (* ? type w *)
 
 module type T = sig
-  type (* type T.t => *) t = Qoo (* <= type T.t *)
+  type (* type T.t => *) t (* <= type T.t *) = Qoo 
   type v = t (* ? type T.t *)
 end
 
 module E = struct let (* module E => *) x (* <= module E *) = 1 end
 
-(* modtype E => *) module type E = sig val x : int end (* <= modtype E *) 
+module type (* modtype E => *) E (* <= modtype E *) = sig val x : int end 
 
 let _ = E (* ? constr E *)
 
-(* exception E => *) exception E (* <= exception E *)
+exception (* exception E => *) E (* <= exception E *)
 
 let _ = raise E (* ? exception E *)
 
 module Module = struct
-  type (* Module.t => *) t = Foo (* <= Module.t *) (* (hopefully old) p4 location handling bug *)
+  type (* Module.t => *) t (* <= Module.t *) = Foo (* (hopefully old) p4 location handling bug *)
 end
 
 type t = Zoo of Module.t (* ? Module.t *) 

tests/type_def.ml

-type (* t => *) t = Foo (* <= t *)
+type (* t => *) t (* <= t *) = Foo 
 
 let _ = (Foo : t (* ? t *))
 
 type (* t1 => *) t1 (* <= t1 *)
 type t2 = t1 (* ? t1 *) list
 
-type (* t3 => *) ('a,'b) t3 (* <= t3 *)
+type ('a,'b) (* t3 => *) t3 (* <= t3 *)
 type ('a, 'b) t4 = ('a, 'b) t3 (* ? t3 *) list
 

tests/types_in_type_def.ml

-type (* t => *) t = Foo (* <= t *)
+type (* t => *) t (* <= t *) = Foo 
 
 type r = {
   foo : t (* ? t *)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.