Skip to content

Commit

Permalink
Add tests for code coverage (configs)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgetzen committed May 29, 2020
1 parent c4a87eb commit 777d505
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
@@ -0,0 +1,12 @@

locals {
foo = 1
}

variable "validation" {
default = 1
validation {
condition = var.validation == 1
error_message = "Must be ${local.foo}." # ERROR: Invalid reference in variable validation
}
}
2 changes: 1 addition & 1 deletion terraform/eval_variable.go
Expand Up @@ -211,7 +211,7 @@ func (n *evalVariableValidations) Eval(ctx EvalContext) (interface{}, error) {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: errInvalidCondition,
Detail: "Validation condition expression must return either true or false, not null.",
Detail: "Validation error message expression must return a string, not null.",
Subject: validation.ErrorMessage.Range().Ptr(),
Expression: validation.ErrorMessage,
EvalContext: hclCtx,
Expand Down

0 comments on commit 777d505

Please sign in to comment.