@@ -11,16 +11,16 @@ import (
1111func TestExpandFlattenExpression_SingleValue (t * testing.T ) {
1212 raw := map [string ]interface {}{
1313 "field" : "agent.tag.key" ,
14- "operator" : "is not " ,
15- "value" : "asd " ,
14+ "operator" : "is_not " ,
15+ "value" : "test " ,
1616 }
1717
1818 exp := expandExpressionV21 (raw )
1919 flat := flattenExpressionV21 (exp )
2020
2121 require .Equal (t , "agent.tag.key" , flat ["field" ])
2222 require .Equal (t , "is_not" , flat ["operator" ])
23- require .Equal (t , "asd " , flat ["value" ])
23+ require .Equal (t , "test " , flat ["value" ])
2424}
2525
2626func TestExpandFlattenExpression_MultipleValues (t * testing.T ) {
@@ -63,7 +63,7 @@ func TestExpandFlattenFilter_MultipleExpressions(t *testing.T) {
6363 map [string ]interface {}{
6464 "field" : "agent.tag.key" ,
6565 "operator" : "is not" ,
66- "value" : "asd " ,
66+ "value" : "test " ,
6767 },
6868 map [string ]interface {}{
6969 "field" : "agent.tag.key2" ,
@@ -95,7 +95,10 @@ func TestFlattenZoneV21_MultipleScopesAndFilters(t *testing.T) {
9595 d := schema .TestResourceDataRaw (t , resourceSysdigSecureZone ().Schema , nil )
9696
9797 scopes := flattenZoneV21 (zone , false )
98- d .Set (SchemaScopeKey , scopes )
98+ err := d .Set (SchemaScopeKey , scopes )
99+ if err != nil {
100+ return
101+ }
99102
100103 if rawScopes , ok := d .Get (SchemaScopeKey ).(* schema.Set ); ok {
101104 scopes := rawScopes .List ()
@@ -122,7 +125,7 @@ func TestExpandFlattenZoneV21_RoundTrip(t *testing.T) {
122125 map [string ]interface {}{
123126 "field" : "agent.tag.key" ,
124127 "operator" : "is_not" ,
125- "value" : "asd " ,
128+ "value" : "test " ,
126129 },
127130 map [string ]interface {}{
128131 "field" : "agent.tag.key2" ,
@@ -140,7 +143,10 @@ func TestExpandFlattenZoneV21_RoundTrip(t *testing.T) {
140143
141144 d2 := schema .TestResourceDataRaw (t , resourceSysdigSecureZone ().Schema , nil )
142145 scopes := flattenZoneV21 (zone , false )
143- d2 .Set (SchemaScopeKey , scopes )
146+ err := d2 .Set (SchemaScopeKey , scopes )
147+ if err != nil {
148+ return
149+ }
144150
145151 require .ElementsMatch (t , d1 .Get ("scope" ).(* schema.Set ).List (), d2 .Get ("scope" ).(* schema.Set ).List ())
146152}
0 commit comments