Skip to content

Commit d211bcb

Browse files
committed
Formatting tests: Added cases for empty slists / stakeholders
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
1 parent 133de4a commit d211bcb

4 files changed

Lines changed: 11 additions & 0 deletions

File tree

tests/format/002_basics.expected.cf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ body common control
55
inputs => { "/var/cfengine/inputs/some_file.cf" };
66
linux::
77
inputs => { "/var/cfengine/inputs/other_file.cf" };
8+
ubuntu::
9+
inputs => {};
810
}
911

1012
promise agent example
@@ -30,6 +32,8 @@ bundle agent main
3032
# Comment at atttribute level
3133
string => "some_value";
3234

35+
"empty_list" slist => {};
36+
3337
classes:
3438
# Comment before promise
3539
"a" if => "b";

tests/format/002_basics.input.cf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ body common control{
55
inputs => { "/var/cfengine/inputs/some_file.cf" };
66
linux::
77
inputs => { "/var/cfengine/inputs/other_file.cf" };
8+
ubuntu::
9+
inputs => {};
810
}
911

1012
promise agent example{
@@ -26,6 +28,9 @@ baz::
2628
if => "bar"
2729
# Comment at atttribute level
2830
string => "some_value";
31+
"empty_list"
32+
slist => {
33+
};
2934
classes:
3035
# Comment before promise
3136
"a" if => "b";

tests/format/010_stakeholder.expected.cf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bundle agent main
22
{
33
packages:
4+
"platform-python-devel" -> {};
45
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" };
56

67
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }

tests/format/010_stakeholder.input.cf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bundle agent main
22
{
33
packages:
4+
"platform-python-devel" -> { };
45
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" };
56
"platform-python-devel" -> { "cfbs shebang", "ENT-1234" }
67
comment => "foo";

0 commit comments

Comments
 (0)