You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected: "<value for var.foo>:1,1-4: Variables not allowed; Variables may not be used here.",
566
+
},
567
+
{
568
+
Name: "invalid expression",
569
+
DeclVars: map[string]*configs.Variable{
570
+
"foo": {ParsingMode: configs.VariableParseHCL},
571
+
},
572
+
Env: map[string]string{
573
+
"TF_VAR_foo": `{"bar": "baz"`,
574
+
},
575
+
Expected: "<value for var.foo>:1,1-2: Unterminated object constructor expression; There is no corresponding closing brace before the end of the file. This may be caused by incorrect brace nesting elsewhere in this file.",
576
+
},
577
+
}
578
+
579
+
for_, tc:=rangecases {
580
+
t.Run(tc.Name, func(t*testing.T) {
581
+
fork, v:=rangetc.Env {
582
+
t.Setenv(k, v)
583
+
}
584
+
585
+
_, diags:=getTFEnvVariables(tc.DeclVars)
586
+
if!diags.HasErrors() {
587
+
t.Fatal("Expected an error to occur, but it didn't")
588
+
}
589
+
590
+
ifdiags.Error() !=tc.Expected {
591
+
t.Errorf("Expected `%s`, but got `%s`", tc.Expected, diags.Error())
0 commit comments