Skip to content

Commit e4d9b7e

Browse files
committed
Adjusted tests for stakeholders and slists and wrapping
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
1 parent 75460d3 commit e4d9b7e

5 files changed

Lines changed: 190 additions & 5 deletions

File tree

tests/format/002_basics.expected.cf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# too deep into edge cases and wrappting etc.
33
body common control
44
{
5-
inputs => {"/var/cfengine/inputs/some_file.cf"};
5+
inputs => { "/var/cfengine/inputs/some_file.cf" };
66
linux::
7-
inputs => {"/var/cfengine/inputs/other_file.cf"};
7+
inputs => { "/var/cfengine/inputs/other_file.cf" };
88
}
99

1010
promise agent example

tests/format/003_wrapping.expected.cf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ bundle agent strings
2121
bundle agent slists
2222
{
2323
vars:
24-
"variable_name" slist => {"one", "two", "three", "four", "five", "six"};
24+
"variable_name" slist => { "one", "two", "three", "four", "five", "six" };
2525

2626
"variable_name"
27-
slist => {"one", "two", "three", "four", "five", "six", "seven"};
27+
slist => { "one", "two", "three", "four", "five", "six", "seven" };
2828

2929
"variable_name"
3030
slist => {
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
bundle agent main
2+
{
3+
packages:
4+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" };
5+
6+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
7+
comment => "foo";
8+
9+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
10+
comment => "Long comment that probably definitely exceeds the set line length limit";
11+
12+
"platform-python-devel" -> {
13+
# foo
14+
};
15+
16+
"platform-python-devel" -> {
17+
# foo
18+
"bar",
19+
# baz
20+
};
21+
22+
"python3-rpm-macros" -> {
23+
"reasons for the change or where to look or who to blame", "ENT-1234"
24+
}
25+
comment => "foo";
26+
27+
"python3-rpm-macros" -> {
28+
"reasons for the change or where to look or who to blame longer than line limit",
29+
"ENT-1234",
30+
}
31+
comment => "foo";
32+
33+
"python3-rpm-macros" -> {
34+
"many",
35+
"different",
36+
"stakeholders",
37+
"for",
38+
"this",
39+
"promise",
40+
}
41+
comment => "foo";
42+
43+
"python3-rpm-macros" -> {
44+
"many",
45+
"different",
46+
"stakeholders",
47+
"for",
48+
"this",
49+
"promise",
50+
};
51+
52+
packages:
53+
any::
54+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" };
55+
56+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
57+
comment => "foo";
58+
59+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
60+
comment => "Long comment that probably definitely exceeds the set line length limit";
61+
62+
"platform-python-devel" -> {
63+
# foo
64+
};
65+
66+
"platform-python-devel" -> {
67+
# foo
68+
"bar",
69+
# baz
70+
};
71+
72+
"python3-rpm-macros" -> {
73+
"reasons for the change or where to look or who to blame", "ENT-1234"
74+
}
75+
comment => "foo";
76+
77+
"python3-rpm-macros" -> {
78+
"reasons for the change or where to look or who to blame longer than line limit",
79+
"ENT-1234",
80+
}
81+
comment => "foo";
82+
83+
"python3-rpm-macros" -> {
84+
"many",
85+
"different",
86+
"stakeholders",
87+
"for",
88+
"this",
89+
"promise",
90+
}
91+
comment => "foo";
92+
93+
"python3-rpm-macros" -> {
94+
"many",
95+
"different",
96+
"stakeholders",
97+
"for",
98+
"this",
99+
"promise",
100+
};
101+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
bundle agent main
2+
{
3+
packages:
4+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" };
5+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
6+
comment => "foo";
7+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
8+
comment => "Long comment that probably definitely exceeds the set line length limit";
9+
"platform-python-devel" -> {
10+
# foo
11+
};
12+
"platform-python-devel" -> {
13+
# foo
14+
"bar",
15+
# baz
16+
};
17+
"python3-rpm-macros" -> {
18+
"reasons for the change or where to look or who to blame", "ENT-1234"
19+
}
20+
comment => "foo";
21+
"python3-rpm-macros" -> {
22+
"reasons for the change or where to look or who to blame longer than line limit",
23+
"ENT-1234",
24+
}
25+
comment => "foo";
26+
"python3-rpm-macros" -> {
27+
"many",
28+
"different",
29+
"stakeholders",
30+
"for",
31+
"this",
32+
"promise",
33+
}
34+
comment => "foo";
35+
"python3-rpm-macros" -> {
36+
"many",
37+
"different",
38+
"stakeholders",
39+
"for",
40+
"this",
41+
"promise",
42+
};
43+
packages:
44+
any::
45+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" };
46+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
47+
comment => "foo";
48+
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
49+
comment => "Long comment that probably definitely exceeds the set line length limit";
50+
"platform-python-devel" -> {
51+
# foo
52+
};
53+
"platform-python-devel" -> {
54+
# foo
55+
"bar",
56+
# baz
57+
};
58+
"python3-rpm-macros" -> {
59+
"reasons for the change or where to look or who to blame", "ENT-1234"
60+
}
61+
comment => "foo";
62+
"python3-rpm-macros" -> {
63+
"reasons for the change or where to look or who to blame longer than line limit",
64+
"ENT-1234",
65+
}
66+
comment => "foo";
67+
"python3-rpm-macros" -> {
68+
"many",
69+
"different",
70+
"stakeholders",
71+
"for",
72+
"this",
73+
"promise",
74+
}
75+
comment => "foo";
76+
"python3-rpm-macros" -> {
77+
"many",
78+
"different",
79+
"stakeholders",
80+
"for",
81+
"this",
82+
"promise",
83+
};
84+
}

tests/unit/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_stringify_single_line_nodes():
4848
_leaf("string", '"b"'),
4949
_leaf("}"),
5050
]
51-
assert stringify_single_line_nodes(nodes) == '{"a", "b"}'
51+
assert stringify_single_line_nodes(nodes) == '{ "a", "b" }'
5252
nodes = [
5353
_leaf("identifier", "package_name"),
5454
_leaf("=>"),

0 commit comments

Comments
 (0)