-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🐛 fix `contains` on `dict` type We are experiencing issues where two `dict` types being compared don't come up with the right results. Here is an example I ran to produce this: ```coffee > region = terraform.plan.variables.where( name == "gcp_region" ).first.value; terraform.plan.variables.where(name == "service_vpc_connector").all(v: v.value.contains(region) ) [failed] [].all() actual: [ 0: terraform.plan.variable value="projects/prj-acc7/locations/us-central1/connectors/preprod-gen-central1-01" name="service_vpc_connector" ] ``` As you can see above we are looking at the `value` of the varaible, which clearly is set to the region but doesn't come up. If we print out the variables individually, it all comes out correctly. The problem is that the string comparison doesn't work when we work with `dict` types because in that example we have to create code that has to with with arbitrary content and work with filtering on another `dict`. This PR fixes the issue. ```coffee > region = terraform.plan.variables.where( name == "gcp_region" ).first.value; terraform.plan.variables.where(name == "service_vpc_connector").all(v: v.value.contains(region) ) [ok] value: true ``` * 🐛 add missing string.contains(dict) Signed-off-by: Dominik Richter <[email protected]> * 🐛 add missing string.contains(array(dict)) Signed-off-by: Dominik Richter <[email protected]> --------- Signed-off-by: Dominik Richter <[email protected]>
- Loading branch information
Showing
6 changed files
with
200 additions
and
94 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
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
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
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
Oops, something went wrong.