# Test that nested variables including namespaces are expanded correctly

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

bundle agent init
{
  meta:
      "tags" slist => { "redmine6349" };

  vars:
      "dummy" string => "dummy";
}

bundle agent check
{

  methods:
    "Check" usebundle => check2("default:init");

}

bundle agent check2(data_bundle)
{
  classes:
    "ok" expression => strcmp("$($(data_bundle).dummy)", "dummy");

  reports:
    DEBUG::
      "Nested: '$(data_bundle).dummy' = $($(data_bundle).dummy)";
      "Not Nested: '$(data_bundle).dummy' = $(default:init.dummy)";

    ok::
      "$(this.promise_filename) Pass";
    !ok::
      "$(this.promise_filename) FAIL";


}
