1####################################################### 2# 3# Test getindices(), size 1 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 21 files: 22 "$(G.testfile).expected" 23 create => "true", 24 edit_line => init_insert; 25} 26 27bundle edit_line init_insert 28{ 29 insert_lines: 30 "alpha"; 31} 32 33####################################################### 34 35bundle agent test 36{ 37 vars: 38 "array[alpha]" string => "zero"; 39 40 "keys" slist => getindices("array"); 41 42 files: 43 "$(G.testfile).actual" 44 create => "true", 45 edit_line => test_insert; 46 47 reports: 48 DEBUG:: 49 "Inserting line: $(keys)"; 50} 51 52bundle edit_line test_insert 53{ 54 vars: 55 "keys" slist => { @{test.keys} }; 56 57 insert_lines: 58 "$(keys)"; 59} 60 61####################################################### 62 63bundle agent check 64{ 65 methods: 66 "any" usebundle => sorted_check_diff("$(G.testfile).actual", 67 "$(G.testfile).expected", 68 "$(this.promise_filename)"); 69} 70 71