@@ -8,17 +8,18 @@ let run s =
8
8
let pe = Parse. expression (Lexing. from_string s) in
9
9
let te = Typecore. type_expression Env. initial pe in
10
10
let ute = Untypeast. untype_expression te in
11
- Format. asprintf " %a" Pprintast. expression ute
11
+ Format. printf " %a@. " Pprintast. expression ute
12
12
;;
13
13
14
14
[%% expect{|
15
- val run : string -> string = < fun>
15
+ val run : string -> unit = < fun>
16
16
|}];;
17
17
18
18
run {| match None with Some (Some _) -> () | _ -> () | };;
19
19
20
20
[%% expect{|
21
- - : string = " match None with | Some (Some _) -> () | _ -> ()"
21
+ match None with | Some (Some _ ) -> () | _ -> ()
22
+ - : unit = ()
22
23
| }];;
23
24
24
25
(* **********************************)
@@ -28,14 +29,16 @@ run {| match None with Some (Some _) -> () | _ -> () |};;
28
29
run {| fun x y z -> function w -> x y z w | };;
29
30
30
31
[%% expect{|
31
- - : string = " fun x y z -> function | w -> x y z w"
32
+ fun x y z -> function | w -> x y z w
33
+ - : unit = ()
32
34
| }];;
33
35
34
36
(* 3-ary function returning a 1-ary function *)
35
37
run {| fun x y z -> (function w -> x y z w) | };;
36
38
37
39
[%% expect{|
38
- - : string = " fun x y z -> (function | w -> x y z w)"
40
+ fun x y z -> (function | w -> x y z w)
41
+ - : unit = ()
39
42
| }];;
40
43
41
44
(* **********************************)
@@ -44,12 +47,13 @@ run {| fun x y z -> (function w -> x y z w) |};;
44
47
run {| let foo : 'a. 'a -> 'a = fun x -> x in foo | }
45
48
46
49
[%% expect{|
47
- - : string = " let foo : 'a . 'a -> 'a = fun x -> x in foo"
50
+ let foo : 'a . 'a -> 'a = fun x -> x in foo
51
+ - : unit = ()
48
52
| }];;
49
53
50
54
run {| let foo : type a . a -> a = fun x -> x in foo | }
51
55
52
56
[%% expect{|
53
- - : string =
54
- " let foo : 'a . 'a -> 'a = fun (type a) -> (fun x -> x : a -> a) in foo "
57
+ let foo : 'a . 'a -> 'a = fun ( type a ) -> ( fun x -> x : a -> a) in foo
58
+ - : unit = ()
55
59
| }]
0 commit comments