@@ -20,10 +20,7 @@ func Test_getDataSourcePolicy(t *testing.T) {
2020 type args struct {
2121 currentPath string
2222 resourceName string
23- // inputVars seeds the variable map passed to getDataSourcePolicy.
24- // nil means an empty map (no var/local context), which is fine for
25- // fixtures that contain no variable references.
26- inputVars converter.VariableMap
23+ inputVars converter.VariableMap // nil means empty map
2724 }
2825 tests := []struct {
2926 name string
@@ -49,9 +46,7 @@ func Test_getDataSourcePolicy(t *testing.T) {
4946` ,
5047 },
5148 {
52- // Production path: getInputVariables sets "var" as a cty.Object of
53- // resolved defaults. A no-default variable is absent from the object,
54- // so var.sid_value raises "Unsupported attribute".
49+ // "var" present but no default: raises "Unsupported attribute".
5550 name : "should not drop policy when scalar fields reference variables with no default (production var context)" ,
5651 args : args {
5752 currentPath : filepath .Join (".." , ".." , ".." , "test" , "fixtures" , "test_terraform_data_source_unknown_vars" ),
@@ -62,8 +57,7 @@ func Test_getDataSourcePolicy(t *testing.T) {
6257` ,
6358 },
6459 {
65- // Absent var context: "var" not in inputVars at all, so var.sid_value
66- // raises "Unknown variable".
60+ // "var" absent entirely: raises "Unknown variable".
6761 name : "should not drop policy when scalar fields reference variables with no var context" ,
6862 args : args {
6963 currentPath : filepath .Join (".." , ".." , ".." , "test" , "fixtures" , "test_terraform_data_source_unknown_vars" ),
0 commit comments