#######################################################
#
# Alphanum field, lowercase
#
#######################################################

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

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

bundle agent init
{
  vars:
      "states" slist => { "actual", "expected" };

      "actual" string =>
      "able:baker,booker,banker:charlie:delta:echo
apple:banana:carrot:dogfood
aardvark:baboon:colugo:dingo::fox
ampallang:: :dydoe:,:::::
:blowfish:conger:dogfish:eel:flounder";

      "expected" string =>
      "able:baker,booker,banker+xxx:charlie:delta:echo
apple:banana+xxx:carrot:dogfood
aardvark:baboon+xxx:colugo:dingo::fox
ampallang:xxx: :dydoe:,:::::
:blowfish:conger:dogfish:eel:flounder";

  files:
      "$(G.testfile).$(states)"
      create => "true",
      edit_line => init_insert("$(init.$(states))"),
      edit_defaults => init_empty;
}

bundle edit_line init_insert(str)
{
  insert_lines:
      "$(str)";
}

body edit_defaults init_empty
{
      empty_file_before_editing => "true";
}

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

bundle agent test
{
  files:
      "$(G.testfile).actual"
      edit_line => test_edit;

}

bundle edit_line test_edit
{
  field_edits:
      "a.*"
      edit_field => test_col;
}

body edit_field test_col
{
      allow_blank_fields => "true";
      extend_fields => "true";
      field_operation => "alphanum";
      field_separator => ":";
      field_value => "xxx";
      select_field => "2";
      start_fields_from_zero => "false";
      value_separator => "+";
}

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

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

### PROJECT_ID: core
### CATEGORY_ID: 27
