File: test_conf.ml

package info (click to toggle)
ocamlformat 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,820 kB
  • sloc: ml: 65,176; pascal: 4,877; lisp: 229; sh: 217; makefile: 121
file content (19 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
open Ocamlformat_lib

let find name =
  List.find (fun Conf_decl.UI.{names; _} ->
      List.exists (String.equal name) names )

let test_ui =
  let test test_name opt ~names:expected_names =
    ( test_name
    , `Quick
    , fun () ->
        let Conf_decl.UI.{names; _} = opt in
        Alcotest.check Alcotest.(list string) test_name expected_names names
    )
  in
  [ test "margin" (find "margin" Conf.UI.fmt_opts) ~names:["m"; "margin"]
  ; test "profile" Conf.UI.profile ~names:["p"; "profile"] ]

let tests = test_ui