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