1####################################################### 2# 3# Test escape() - basic tests inside an slist 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 common g 15{ 16 vars: 17 "dummy" string => "dummy"; 18} 19 20####################################################### 21 22bundle agent init 23{ 24 vars: 25 "dummy" string => "dummy"; 26} 27 28####################################################### 29 30bundle agent test 31{ 32 vars: 33 "s1" slist => { 34 "bstr", 35 escape("foo"), 36 escape("foo.baz"), 37 escape("foo[baz]"), 38 "estr", 39 }; 40 "t1" string => join(",","s1"); 41 "e1" string => "bstr,foo,foo.baz,foo[baz],estr"; 42} 43 44####################################################### 45 46bundle agent check 47{ 48 classes: 49 "ok" and => { 50 regcmp("$(test.t1)", "$(test.e1)"), 51 }; 52 53 reports: 54 DEBUG:: 55 "'$(test.t1)' comprises $(s1)"; 56 "Comparing actual vs. expected:"; 57 "'$(test.t1)' vs. '$(test.e1)'"; 58 ok:: 59 "$(this.promise_filename) Pass"; 60 61 !ok:: 62 "$(this.promise_filename) FAIL"; 63} 64