#######################################################
#
# Test getvalues(), size 5 with a duplicate and a triplicate
#
#######################################################

body common control
{
      inputs => { "../../default.cf.sub" };
      bundlesequence  => { default("$(this.promise_filename)") };   
      version => "1.0";
}

bundle agent init
{
  vars:
      "zero" string => "zero";
      "one" string => "one";

  files:
      "$(G.testfile).expected"
      create => "true",
      edit_line => init_insert;
}

bundle edit_line init_insert
{
  insert_lines:
      "zero";
      "one";
}

#######################################################

bundle agent test
{
  vars:
      "array[alpha]" string => "zero";
      "array[beta]" string => "$(zero)";
      "array[gamma's]" string => "one";
      "array[delta-delta:delta]" string => "$(one)";
      "array[last]" string => "one";

      "vals" slist => getvalues("array");

  files:
      "$(G.testfile).actual"
      create => "true",
      edit_line => test_insert;

  reports:
    DEBUG::
      "Inserting line: $(vals)";
}

bundle edit_line test_insert
{
  vars:
      "vals" slist => { @{test.vals} };

  insert_lines:
      "$(vals)";
}

#######################################################

bundle agent check
{
  methods:
      "any" usebundle => sorted_check_diff("$(G.testfile).actual",
					   "$(G.testfile).expected",
					   "$(this.promise_filename)");
}

#######################################################

bundle agent fini
{
  methods:
      "any" usebundle => dcs_fini("$(G.testfile).*");
}
