@@ -20,25 +20,23 @@ var cmpOpts = cmpopts.IgnoreUnexported(Provider{})
2020
2121func TestMarshalProvider (t * testing.T ) {
2222 tests := []struct {
23- Input providers.ProviderSchema
24- IncludeExperimental bool
25- Want * Provider
23+ Input providers.ProviderSchema
24+ Want * Provider
2625 }{
2726 {
2827 providers.ProviderSchema {},
29- false ,
3028 & Provider {
3129 Provider : & Schema {},
3230 ResourceSchemas : map [string ]* Schema {},
3331 DataSourceSchemas : map [string ]* Schema {},
3432 EphemeralResourceSchemas : map [string ]* Schema {},
3533 ResourceIdentitySchemas : map [string ]* IdentitySchema {},
34+ ListResourceSchemas : map [string ]* Schema {},
3635 ActionSchemas : map [string ]* ActionSchema {},
3736 },
3837 },
3938 {
4039 testProvider (),
41- false ,
4240 & Provider {
4341 Provider : & Schema {
4442 Block : & Block {
@@ -212,53 +210,6 @@ func TestMarshalProvider(t *testing.T) {
212210 },
213211 },
214212 },
215- ResourceIdentitySchemas : map [string ]* IdentitySchema {},
216- ActionSchemas : map [string ]* ActionSchema {},
217- },
218- },
219- {
220- providers.ProviderSchema {
221- ListResourceTypes : map [string ]providers.Schema {
222- "test_list_resource" : {
223- Version : 1 ,
224- Body : & configschema.Block {
225- Attributes : map [string ]* configschema.Attribute {
226- "data" : {
227- Type : cty .DynamicPseudoType ,
228- Computed : true ,
229- },
230- },
231- BlockTypes : map [string ]* configschema.NestedBlock {
232- "config" : {
233- Block : configschema.Block {
234- Attributes : map [string ]* configschema.Attribute {
235- "filter" : {Type : cty .String , Optional : true },
236- "items" : {Type : cty .List (cty .String ), Required : true },
237- },
238- },
239- Nesting : configschema .NestingSingle ,
240- },
241- },
242- },
243- },
244- },
245- Actions : map [string ]providers.ActionSchema {
246- "test_action" : {
247- ConfigSchema : & configschema.Block {
248- Attributes : map [string ]* configschema.Attribute {
249- "opt_attr" : {Type : cty .String , Optional : true },
250- "req_attr" : {Type : cty .List (cty .String ), Required : true },
251- },
252- },
253- },
254- },
255- },
256- true ,
257- & Provider {
258- Provider : & Schema {},
259- ResourceSchemas : map [string ]* Schema {},
260- DataSourceSchemas : map [string ]* Schema {},
261- EphemeralResourceSchemas : map [string ]* Schema {},
262213 ListResourceSchemas : map [string ]* Schema {
263214 "test_list_resource" : {
264215 Version : 1 ,
@@ -305,7 +256,7 @@ func TestMarshalProvider(t *testing.T) {
305256
306257 for i , test := range tests {
307258 t .Run (fmt .Sprint (i ), func (t * testing.T ) {
308- got := marshalProvider (test .Input , test . IncludeExperimental )
259+ got := marshalProvider (test .Input )
309260 if diff := cmp .Diff (test .Want , got , cmpOpts ); diff != "" {
310261 t .Fatalf ("wrong result:\n %s\n " , diff )
311262 }
@@ -431,5 +382,15 @@ func testProvider() providers.ProviderSchema {
431382 },
432383 },
433384 },
385+ Actions : map [string ]providers.ActionSchema {
386+ "test_action" : {
387+ ConfigSchema : & configschema.Block {
388+ Attributes : map [string ]* configschema.Attribute {
389+ "opt_attr" : {Type : cty .String , Optional : true },
390+ "req_attr" : {Type : cty .List (cty .String ), Required : true },
391+ },
392+ },
393+ },
394+ },
434395 }
435396}
0 commit comments