MCPcopy
hub / github.com/caddyserver/caddy / TestFormatter

Function TestFormatter

caddyconfig/caddyfile/formatter_test.go:22–507  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20)
21
22func TestFormatter(t *testing.T) {
23 for i, tc := range []struct {
24 description string
25 input string
26 expect string
27 }{
28 {
29 description: "very simple",
30 input: `abc def
31 g hi jkl
32mn`,
33 expect: `abc def
34g hi jkl
35mn`,
36 },
37 {
38 description: "basic indentation, line breaks, and nesting",
39 input: ` a
40b
41
42 c {
43 d
44}
45
46e { f
47}
48
49
50
51g {
52h {
53i
54}
55}
56
57j { k {
58l
59}
60}
61
62m {
63 n { o
64 }
65 p { q r
66s }
67}
68
69 {
70{ t
71 u
72
73 v
74
75w
76}
77}`,
78 expect: `a
79b

Callers

nothing calls this directly

Calls 1

FormatFunction · 0.85

Tested by

no test coverage detected