Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix ocamldoc test to follow new interface; add object type test

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14910 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
commit 577ea36b88d3f5dcd06f44d7a5529418f33040eb 1 parent 1a3b58b
@reseau-loops reseau-loops authored
View
14 testsuite/tests/tool-ocamldoc/odoc_test.ml
@@ -53,7 +53,19 @@ class string_gen =
p fmt "# manifest (Odoc_info.string_of_type_expr):\n<[%s]>\n"
(match t.ty_manifest with
None -> "None"
- | Some e -> Odoc_info.string_of_type_expr e
+ | Some (Other e) -> Odoc_info.string_of_type_expr e
+ | Some (Object_type fields) ->
+ let b = Buffer.create 256 in
+ Buffer.add_string b "<";
+ List.iter
+ (fun fd ->
+ Printf.bprintf b " %s: %s ;"
+ fd.of_name
+ (Odoc_info.string_of_type_expr fd.of_type)
+ )
+ fields;
+ Buffer.add_string b " >";
+ Buffer.contents b
);
);
View
3  testsuite/tests/tool-ocamldoc/t01.ml
@@ -16,4 +16,7 @@ module type MT = sig
(string * string * string) ->
(string * string * string) -> unit
val y : int
+
+ type obj_type =
+ < foo : int ; bar : float -> string ; gee : int -> (int * string) >
end
View
5 testsuite/tests/tool-ocamldoc/t01.reference
@@ -23,6 +23,8 @@
string * string * string ->
string * string * string -> string * string * string -> unit
val y : int
+ type obj_type =
+ < bar : float -> string; foo : int; gee : int -> int * string >
end]>
# type T01.MT.t:
# manifest (Odoc_info.string_of_type_expr):
@@ -31,3 +33,6 @@ end]>
string ->
string * string * string ->
string * string * string -> string * string * string -> unit]>
+# type T01.MT.obj_type:
+# manifest (Odoc_info.string_of_type_expr):
+<[< bar: float -> string ; foo: int ; gee: int -> int * string ; >]>
Please sign in to comment.
Something went wrong with that request. Please try again.