1#######################################################
2#
3# Test grep(), size 0, global array
4#
5#######################################################
6
7body common control
8{
9      inputs => { "../../default.cf.sub" };
10      bundlesequence  => { default("$(this.promise_filename)") };
11      version => "1.0";
12}
13
14bundle agent init
15{
16  vars:
17      "dummy" string => "dummy";
18
19  files:
20      "$(G.testfile).expected"
21      create => "true";
22}
23
24#######################################################
25
26bundle agent test
27{
28  vars:
29      "array" slist => { "One", "Two", "Three", "Four", "Five" };
30
31      "vals" slist => grep("Z.*", "test.array");
32
33  files:
34      "$(G.testfile).actual"
35      create => "true",
36      edit_line => test_insert;
37
38  reports:
39    DEBUG::
40      "Inserting line: $(vals)";
41}
42
43bundle edit_line test_insert
44{
45  vars:
46      "vals" slist => { @{test.vals} };
47
48  insert_lines:
49      "$(vals)";
50}
51
52#######################################################
53
54bundle agent check
55{
56  methods:
57      "any" usebundle => sorted_check_diff("$(G.testfile).actual",
58					   "$(G.testfile).expected",
59					   "$(this.promise_filename)");
60}
61