Created
August 10, 2013 15:18
-
-
Save teroka/6200812 to your computer and use it in GitHub Desktop.
ifelse() bug?
This file contains hidden or 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
body common control { bundlesequence => { "example" }; } | |
bundle agent example { | |
vars: | |
"foo[1]" string => "foo[1]"; | |
"foo[2]" string => "foo[2]"; | |
"foo[default]" string => "foo[default]"; | |
"randomvar" string => "foobar"; | |
secondpass:: | |
# additional tests | |
"failtest1" string => ifelse("$(randomvar)_set","$(foo[1])","!$(randomvar)_set","$(foo[2])","$(foo[default])"); | |
"failtest2" string => ifelse("$(randomvar)_set","$(foo[1])","!$(randomvar)_set","$(nonexistent[var])","$(foo[default])"); | |
"failtest3" string => ifelse("!$(randomvar)_set","$(nonexistent[var])","$(foo[default])"); | |
classes: | |
"secondpass" expression => "any"; | |
"$(randomvar)_set" expression => "any"; | |
reports: | |
secondpass:: | |
"failtest1 result = \"$(failtest1)\" - should be foo[1]"; | |
"failtest2 result = \"$(failtest2)\" - should be foo[1]"; | |
"failtest3 result = \"$(failtest3)\" - should be foo[default]"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment