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

bundle agent test
{
  meta:
    "descripton" -> { "ENT-5042" }
      string => "Test that readstringlist correctly ignores many comment lines";

  # https://regex101.com/r/OZUgku/1/
  vars:
    "my_list_of_strings"
      slist => readstringlist(
        "$(this.promise_filename).list.txt",
        # File to read
        "\s*#[^\n]*",
        # Exclude hash comment lines
        "\s",
        # Split on whitespace
        inf,
        # Maximum number of entries
        inf
      );

      # Maximum number of bytes to read
}

bundle agent check
{
  vars:
    "expected" slist => { "jay", "dave" };

  methods:
    "Pass/FAIL"
      usebundle => dcs_check_diff_elements(
        @(test.my_list_of_strings),
        # First set of elements
        @(expected),
        # Second set of elements
        $(this.promise_filename),
        # Full path to test policy file
        "no"
      );

      # Expected difference in elements
}
