1#######################################################
2#
3# Test readstringlist() issue 364
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  files:
19      "$(G.testfile)"
20      delete => init_delete;
21
22      "$(G.testfile)"
23      create => "true",
24      edit_line => init_fill_in;
25}
26
27bundle edit_line init_fill_in
28{
29  insert_lines:
30      "123.456";
31}
32
33body delete init_delete
34{
35      dirlinks => "delete";
36      rmdirs   => "true";
37}
38
39#######################################################
40
41bundle agent test
42{
43  vars:
44      "nums" slist => readstringlist("$(G.testfile)","NoComment","\.",5,100);
45      "sum" real => sum("nums");
46}
47
48#######################################################
49
50bundle agent check
51{
52  vars:
53      "nums" slist => { @{test.nums} };
54
55  classes:
56      "ok_list" not => strcmp("won't match", "$(nums)");
57      "ok123" expression => strcmp("123", "$(nums)");
58      "ok456" expression => strcmp("456", "$(nums)");
59      "ok" and => { "ok_list", "ok123", "ok456",
60                    islessthan("$(test.sum)", "579.1"),
61                    isgreaterthan("$(test.sum)", "578.9")
62      };
63
64  reports:
65    DEBUG::
66      "nums: $(nums)";
67      "sum: $(test.sum)";
68    ok::
69      "$(this.promise_filename) Pass";
70    !ok::
71      "$(this.promise_filename) FAIL";
72}
73
74