Skip to content

Commit

Permalink
Add CLI test for --indent
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetiot committed Feb 17, 2020
1 parent 6392053 commit 4ffff85
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/cli/dune
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,29 @@
(name runtest)
(action
(diff env_unknown_value.expected env_unknown_value.output)))

(rule
(targets line_indent_2.output)
(deps .ocamlformat)
(action
(with-outputs-to
%{targets}
(system "%{bin:ocamlformat} %{dep:sample/c.ml} --indent 6"))))

(alias
(name runtest)
(action
(diff line_indent_2.expected line_indent_2.output)))

(rule
(targets line_indent_4.output)
(deps .ocamlformat)
(action
(with-outputs-to
%{targets}
(system "%{bin:ocamlformat} %{dep:sample/c.ml} --indent 4"))))

(alias
(name runtest)
(action
(diff line_indent_4.expected line_indent_4.output)))
1 change: 1 addition & 0 deletions test/cli/line_indent_2.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
1 change: 1 addition & 0 deletions test/cli/line_indent_4.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
7 changes: 7 additions & 0 deletions test/cli/sample/c.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let foooooooooooo = let foooooooo = foooooooooooo in foooooooooooo

let foooooooooooo = let foooooooooooooo =
let woooooooooooooooo = koooooooooooooooo in
baaaaaar
in
hooohoooo

0 comments on commit 4ffff85

Please sign in to comment.