Skip to content

Commit

Permalink
Force terminal to "DUMP" for reproducible test cases.
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/release/3.12.0+beta1@10595 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
xclerc committed Jun 18, 2010
1 parent 3754c02 commit f83060e
Show file tree
Hide file tree
Showing 6 changed files with 524 additions and 523 deletions.
2 changes: 1 addition & 1 deletion testsuite/Makefile
Expand Up @@ -33,7 +33,7 @@ one: lib


exec-one: exec-one:
@echo "Running tests from '$$DIR' ..." @echo "Running tests from '$$DIR' ..."
@(cd $(DIR) && $(MAKE) BASEDIR=$(BASEDIR) && cd ../..) @(cd $(DIR) && $(MAKE) TERM=dumb BASEDIR=$(BASEDIR) && cd ../..)


lib: FORCE lib: FORCE
@(cd lib && $(MAKE) -s BASEDIR=$(BASEDIR) && cd ..) @(cd lib && $(MAKE) -s BASEDIR=$(BASEDIR) && cd ..)
Expand Down
63 changes: 32 additions & 31 deletions testsuite/tests/typing-objects/Exemples.ml.reference
Expand Up @@ -24,13 +24,13 @@
# val get_x : < get_x : 'a; .. > -> 'a = <fun> # val get_x : < get_x : 'a; .. > -> 'a = <fun>
# val set_x : < set_x : 'a; .. > -> 'a = <fun> # val set_x : < set_x : 'a; .. > -> 'a = <fun>
# - : int list = [10; 5] # - : int list = [10; 5]
# # # Characters 7-96:
class ref x_init = object ......ref x_init = object
val mutable x = x_init val mutable x = x_init
method get = x method get = x
method set y = x <- y method set y = x <- y
end;; end..
Error: Some type variables are unbound in this type: Error: Some type variables are unbound in this type:
class ref : class ref :
'a -> 'a ->
object object
Expand Down Expand Up @@ -75,24 +75,29 @@ val c' : color_point circle = <obj>
method move : int -> unit method move : int -> unit
method set_center : 'a -> unit method set_center : 'a -> unit
end end
# # # Characters 28-29:
let c'' = new color_circle p;; let c'' = new color_circle p;;
Error: This expression has type point but an expression was expected of type ^
Error: This expression has type point but an expression was expected of type
#color_point #color_point
The first object type has no method color The first object type has no method color
# val c'' : color_point color_circle = <obj> # val c'' : color_point color_circle = <obj>
# - : color_point circle = <obj> # - : color_point circle = <obj>
# # (c'' :> point circle);; (* Echec *) # Characters 0-21:
Error: Type (c'' :> point circle);; (* Echec *)
^^^^^^^^^^^^^^^^^^^^^
Error: Type
color_point color_circle = color_point color_circle =
< center : color_point; color : string; move : int -> unit; < center : color_point; color : string; move : int -> unit;
set_center : color_point -> unit > set_center : color_point -> unit >
is not a subtype of is not a subtype of
point circle = point circle =
< center : point; move : int -> unit; set_center : point -> unit > < center : point; move : int -> unit; set_center : point -> unit >
Type point = point is not a subtype of color_point = color_point Type point = point is not a subtype of color_point = color_point
# # fun x -> (x : color_point color_circle :> point circle);; # Characters 9-55:
Error: Type fun x -> (x : color_point color_circle :> point circle);;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Type
color_point color_circle = color_point color_circle =
< center : color_point; color : string; move : int -> unit; < center : color_point; color : string; move : int -> unit;
set_center : color_point -> unit > set_center : color_point -> unit >
Expand All @@ -110,18 +115,10 @@ Type point = point is not a subtype of color_point = color_point
end end
# val p : printable_point = <obj> # val p : printable_point = <obj>
# 7- : unit = () # 7- : unit = ()
# # # Characters 85-102:
class printable_color_point y c = object (self) inherit printable_point y as super
inherit color_point y c ^^^^^^^^^^^^^^^^^
inherit printable_point y as super Warning 13: the following instance variables are overridden by the class printable_point :
method print =
print_string "(";
super#print;
print_string ", ";
print_string (self#color);
print_string ")"
end;;
Warning 13: the following instance variables are overridden by the class printable_point :
x x
The behaviour changed in ocaml 3.10 (previous behaviour was hiding.) The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
class printable_color_point : class printable_color_point :
Expand Down Expand Up @@ -210,8 +207,10 @@ and ['a] cons :
# val c : int_comparable = <obj> # val c : int_comparable = <obj>
# - : unit = () # - : unit = ()
# val c2 : int_comparable2 = <obj> # val c2 : int_comparable2 = <obj>
# # l#add (c2 :> int_comparable);; (* Echec : 'a comp2 n'est un sous-type *) # Characters 6-28:
Error: Type l#add (c2 :> int_comparable);; (* Echec : 'a comp2 n'est un sous-type *)
^^^^^^^^^^^^^^^^^^^^^^
Error: Type
int_comparable2 = int_comparable2 =
< leq : int_comparable2 -> bool; set_x : int -> unit; x : int > < leq : int_comparable2 -> bool; set_x : int -> unit; x : int >
is not a subtype of is not a subtype of
Expand All @@ -231,8 +230,10 @@ is not a subtype of
end end
# val c3 : int_comparable3 = <obj> # val c3 : int_comparable3 = <obj>
# - : unit = () # - : unit = ()
# # (new sorted_list ())#add c3;; (* Echec : leq n'est pas binaire *) # Characters 25-27:
Error: This expression has type (new sorted_list ())#add c3;; (* Echec : leq n'est pas binaire *)
^^
Error: This expression has type
int_comparable3 = int_comparable3 =
< leq : int_comparable -> bool; setx : int -> unit; x : int > < leq : int_comparable -> bool; setx : int -> unit; x : int >
but an expression was expected of type but an expression was expected of type
Expand All @@ -243,10 +244,10 @@ is not a subtype of
< leq : int_comparable -> bool; setx : int -> unit; x : int > < leq : int_comparable -> bool; setx : int -> unit; x : int >
The first object type has no method setx The first object type has no method setx
# val sort : (#comparable as 'a) list -> 'a list = <fun> # val sort : (#comparable as 'a) list -> 'a list = <fun>
# # let pr l = # Characters 13-66:
List.map (fun c -> print_int c#x; print_string " ") l; List.map (fun c -> print_int c#x; print_string " ") l;
print_newline ();; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning 10: this expression should have type unit. Warning 10: this expression should have type unit.
val pr : < x : int; .. > list -> unit = <fun> val pr : < x : int; .. > list -> unit = <fun>
# val l : int_comparable list = [<obj>; <obj>; <obj>] # val l : int_comparable list = [<obj>; <obj>; <obj>]
# 5 2 4 # 5 2 4
Expand Down

0 comments on commit f83060e

Please sign in to comment.