File tree Expand file tree Collapse file tree 7 files changed +18
-5
lines changed
misc/environment-variable-unset Expand file tree Collapse file tree 7 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1313#### Fixed
1414
1515- Fix accidental redirect of stderr to stdout (#343 , @Leonidas-from-XIV )
16+ - Remove trailing whitespaces that were added to indent empty lines (#341 , @gpetiot )
1617
1718#### Removed
1819
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ let dump ppf = function
2323 | `Output s -> Fmt. pf ppf " `Output %S" s
2424 | `Ellipsis -> Fmt. pf ppf " `Ellipsis"
2525
26- let pp ?(pad = 0 ) ppf = function
26+ let pp ?(pad = 0 ) ?syntax ppf = function
27+ | `Output "" when syntax <> Some Syntax. Cram -> Fmt. pf ppf " \n "
2728 | `Output s -> Fmt. pf ppf " %a%s\n " pp_pad pad s
2829 | `Ellipsis -> Fmt. pf ppf " %a...\n " pp_pad pad
2930
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ val merge : [ `Output of string ] list -> t list -> t list
2828(* * [merge output test] merges any [`Ellipsis] items from [test] into
2929 [output]. *)
3030
31- val pp : ?pad : int -> t Fmt .t
31+ val pp : ?pad : int -> ? syntax : Syntax .t -> t Fmt .t
3232(* * [pp] is the pretty-printer for test outputs. [pad] is the size of
3333 the optional whitespace left-padding (by default it is 0). *)
3434
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ let run_cram_tests ?syntax t ?root ppf temp_file pad tests =
115115 | `Ellipsis -> Output. pp ~pad ppf `Ellipsis
116116 | `Output line ->
117117 let line = ansi_color_strip line in
118- Output. pp ~pad ppf (`Output line))
118+ Output. pp ?syntax ~pad ppf (`Output line))
119119 output;
120120 Cram. pp_exit_code ~pad ppf n)
121121 tests;
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ This shell block contains an empty line within a padded block:
55
66```
77
8+ ``` sh
9+ $ echo " Hello..." && echo " " && echo " world!"
10+ ```
11+
812This toplevel block contains an empty line within a padded block:
913
1014``` ocaml
Original file line number Diff line number Diff line change @@ -2,7 +2,14 @@ This shell block contains an empty line within a padded block:
22
33```sh
44 $ echo ''
5-
5+
6+ ```
7+
8+ ```sh
9+ $ echo "Hello..." && echo "" && echo "world!"
10+ Hello...
11+
12+ world!
613```
714
815This toplevel block contains an empty line within a padded block:
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ Environment variables can be unset in an shell and bash blocks.
77
88``` sh unset-VAR
99 $ echo $VAR
10-
10+
1111```
You can’t perform that action at this time.
0 commit comments