Skip to content

Commit 565538c

Browse files
committed
Add acceptance test
Ticket: CFE-2930 Signed-off-by: Bastian Triller <bastian.triller@gmail.com>
1 parent c1bce0e commit 565538c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
body common control
2+
{
3+
inputs => { "../../default.cf.sub" };
4+
bundlesequence => { default("$(this.promise_filename)") };
5+
version => "1.0";
6+
}
7+
8+
#######################################################
9+
10+
bundle agent test
11+
{
12+
13+
meta:
14+
"description" -> { "CFE-2930" }
15+
string => "Test that getindices() returns the correct indices from a list";
16+
17+
vars:
18+
"list" slist => { "beta", "alpha", "gamma" };
19+
"getindices_list" slist => getindices( list );
20+
}
21+
22+
#######################################################
23+
bundle agent check
24+
{
25+
vars:
26+
"expected_value" string => "beta";
27+
"first_index" string => nth( "test.getindices_list", 0 );
28+
29+
reports:
30+
"$(this.promise_filename) Pass"
31+
if => and( strcmp( $(first_index), 0 ), strcmp( nth( "test.list", $(first_index) ), $(expected_value) ) );
32+
33+
"$(this.promise_filename) FAIL"
34+
unless => and( strcmp( $(first_index), 0 ), strcmp( nth( "test.list", $(first_index) ), $(expected_value) ) );
35+
}

0 commit comments

Comments
 (0)