Skip to content

Commit 2e8ca54

Browse files
committed
[minor] Make test_untypeast.ml more readable.
1 parent 9fb1b31 commit 2e8ca54

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

testsuite/tests/compiler-libs/test_untypeast.ml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ let run s =
88
let pe = Parse.expression (Lexing.from_string s) in
99
let te = Typecore.type_expression Env.initial pe in
1010
let ute = Untypeast.untype_expression te in
11-
Format.asprintf "%a" Pprintast.expression ute
11+
Format.printf "%a@." Pprintast.expression ute
1212
;;
1313

1414
[%%expect{|
15-
val run : string -> string = <fun>
15+
val run : string -> unit = <fun>
1616
|}];;
1717

1818
run {| match None with Some (Some _) -> () | _ -> () |};;
1919

2020
[%%expect{|
21-
- : string = "match None with | Some (Some _) -> () | _ -> ()"
21+
match None with | Some (Some _) -> () | _ -> ()
22+
- : unit = ()
2223
|}];;
2324

2425
(***********************************)
@@ -28,14 +29,16 @@ run {| match None with Some (Some _) -> () | _ -> () |};;
2829
run {| fun x y z -> function w -> x y z w |};;
2930

3031
[%%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 = ()
3234
|}];;
3335

3436
(* 3-ary function returning a 1-ary function *)
3537
run {| fun x y z -> (function w -> x y z w) |};;
3638

3739
[%%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 = ()
3942
|}];;
4043

4144
(***********************************)
@@ -44,12 +47,13 @@ run {| fun x y z -> (function w -> x y z w) |};;
4447
run {| let foo : 'a. 'a -> 'a = fun x -> x in foo |}
4548

4649
[%%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 = ()
4852
|}];;
4953

5054
run {| let foo : type a . a -> a = fun x -> x in foo |}
5155

5256
[%%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 = ()
5559
|}]

0 commit comments

Comments
 (0)