Skip to content

Commit 0215002

Browse files
committed
Added linting tests for namespaces
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent ca84699 commit 0215002

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

tests/lint/008_namespace.cf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
body file control
2+
{
3+
namespace => "mylib";
4+
}
5+
6+
bundle agent target(a)
7+
{
8+
reports:
9+
"Hello, $(a)";
10+
}
11+
12+
bundle agent helper
13+
{
14+
vars:
15+
"x" string => mylib:target("arg");
16+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
vars:
3+
"x" string => default:target("arg");
4+
^------------^
5+
Error: Call to unknown function / bundle / body 'default:target' at at tests/lint/008_namespace.x.cf:15:19
6+
FAIL: tests/lint/008_namespace.x.cf (1 errors)
7+
Failure, 1 errors in total.

tests/lint/008_namespace.x.cf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
body file control
2+
{
3+
namespace => "mylib";
4+
}
5+
6+
bundle agent target(a)
7+
{
8+
reports:
9+
"Hello, $(a)";
10+
}
11+
12+
bundle agent helper
13+
{
14+
vars:
15+
"x" string => default:target("arg");
16+
}

0 commit comments

Comments
 (0)