Skip to content

Commit 066cbb8

Browse files
Added tests for invalid number of arguments in function calls
1 parent 2d5267d commit 066cbb8

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
bundle agent main
2+
{
3+
vars:
4+
"string"
5+
string => canonify("test");
6+
reports:
7+
"Test => $(string)";
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
"string1"
3+
string => canonify();
4+
^--------^
5+
Error: Expected 1 arguments, received 0 at tests/lint/013_invalid_num_args_func.x.cf:5:15
6+
7+
"string3"
8+
string => canonify("test", "test");
9+
^----------------------^
10+
Error: Expected 1 arguments, received 2 at tests/lint/013_invalid_num_args_func.x.cf:9:15
11+
FAIL: tests/lint/013_invalid_num_args_func.x.cf (2 errors)
12+
Failure, 2 errors in total.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
bundle agent main
2+
{
3+
vars:
4+
"string1"
5+
string => canonify();
6+
"string2"
7+
string => canonify("test");
8+
"string3"
9+
string => canonify("test", "test");
10+
reports:
11+
"Test1 => $(string1)";
12+
"Test2 => $(string2)";
13+
"Test3 => $(string3)";
14+
}

0 commit comments

Comments
 (0)