#######################################################
#
# Test getvalues()
#
#######################################################
# If we run getvalues on a classic array index that contains an slist we should
# end up with a copy of that slist.
body common control
{
  inputs => { "../../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

#######################################################
bundle agent test
{
  vars:
    "array[slist]" slist => { "scrumdiddlyumptious" };
    "values" slist => getvalues("array[slist]");
}

#######################################################
bundle agent check
{
  vars:
    "expected" slist => { "scrumdiddlyumptious" };
    "diff" slist => difference(expected, "test.values");

  classes:
    "_pass" expression => strcmp(length(diff), 0);

  methods:
    _pass::
      "pass" usebundle => dcs_pass("$(this.promise_filename)");

    !_pass::
      "pass" usebundle => dcs_fail("$(this.promise_filename)");
}
