-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5324 from amousset/inheritance-memory
CFE-4254: Allow inheriting attributes using global variables in bodies having local parameters
- Loading branch information
Showing
2 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
tests/acceptance/00_basics/03_bodies/inherit_from_with_global_var.cf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
####################################################### | ||
# | ||
# Test that bodies can inherit attributes containing global variables | ||
# | ||
####################################################### | ||
|
||
body common control | ||
{ | ||
inputs => { "../../default.cf.sub" }; | ||
bundlesequence => { default("$(this.promise_filename)") }; | ||
version => "1.0"; | ||
} | ||
|
||
####################################################### | ||
|
||
|
||
bundle agent init | ||
{ | ||
vars: | ||
"class" string => "_pass"; | ||
} | ||
|
||
####################################################### | ||
|
||
body classes parent(p) | ||
{ | ||
promise_kept => { "${init.class}" }; | ||
} | ||
|
||
body classes static(p) | ||
{ | ||
inherit_from => parent(p); | ||
} | ||
|
||
bundle agent test { | ||
meta: | ||
"description" -> { "CFE-4254" } | ||
string => "Test that bodies can inherit attributes containing global variables"; | ||
|
||
vars: | ||
"test" string => "test", | ||
classes => static("placeholder"); | ||
} | ||
|
||
####################################################### | ||
|
||
bundle agent check | ||
{ | ||
methods: | ||
_pass:: | ||
"pass" usebundle => dcs_pass("$(this.promise_filename)"); | ||
|
||
!_pass:: | ||
"pass" usebundle => dcs_fail("$(this.promise_filename)"); | ||
} |