File: three.ml.corrected.expected

package info (click to toggle)
ppx-expect 0.17.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: ml: 3,399; ansic: 104; javascript: 19; makefile: 15; sh: 2
file content (43 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(*
   In old versions of [ppx_expect], all of the tests below would pass.

   Currently, [ppx_expect] instead enforces standardized formatting in [[%expect]] nodes,
   so we instead use this test to demonstrate that all of the below expectations are
   reformatted to the same thing.
*)

let%expect_test _ =
  let text_no_final_nl () = print_string "one\ntwo\nthree" in
  text_no_final_nl ();
  [%expect
    {|
    one
    two
    three
    |}];
  let text () = print_string "one\ntwo\nthree\n" in
  (* Base example *)
  text ();
  [%expect
    {|
    one
    two
    three
    |}];
  (* ok to omit space between "expect" and "{" *)
  text ();
  [%expect
    {|
    one
    two
    three
    |}];
  (* indentation allowed *)
  text ();
  [%expect
    {|
    one
    two
    three
    |}]
;;