1#######################################################
2#
3# Test getvalues(string), should return the string itself
4#
5#######################################################
6
7body common control
8{
9      inputs => { "../../default.cf.sub" };
10      bundlesequence  => { default("$(this.promise_filename)") };
11      version => "1.0";
12}
13
14#######################################################
15
16bundle agent init
17{
18  vars:
19      "dummy" string => "dummy";
20      "expected" string => "blah";
21
22  files:
23      "$(G.testfile).expected"
24      create => "true",
25      edit_line => init_insert("$(init.expected)"),
26      edit_defaults => init_empty;
27}
28
29bundle edit_line init_insert(str)
30{
31  insert_lines:
32      "$(str)";
33}
34
35body edit_defaults init_empty
36{
37      empty_file_before_editing => "true";
38}
39
40#######################################################
41
42bundle agent test
43{
44  vars:
45      "array" string => "blah"; # Intentionally not an array
46
47      "vals" slist => getvalues("array");
48
49  files:
50      "$(G.testfile).actual"
51      create => "true",
52      edit_line => test_insert;
53
54  reports:
55    DEBUG::
56      "Inserting line: $(vals)";
57}
58
59bundle edit_line test_insert
60{
61  vars:
62      "vals" slist => { @{test.vals} };
63
64  insert_lines:
65      "$(vals)";
66}
67
68#######################################################
69
70bundle agent check
71{
72  methods:
73      "any" usebundle => sorted_check_diff("$(G.testfile).actual",
74                                           "$(G.testfile).expected",
75                                           "$(this.promise_filename)");
76}
77
78