@@ -731,6 +731,80 @@ func TestExpandStringEnum(t *testing.T) {
731
731
runAutoExpandTestCases (ctx , t , testCases )
732
732
}
733
733
734
+ func TestExpandListOfStringEnum (t * testing.T ) {
735
+ t .Parallel ()
736
+
737
+ type testEnum string
738
+ var testEnumFoo testEnum = "foo"
739
+ var testEnumBar testEnum = "bar"
740
+
741
+ var testEnums []testEnum
742
+ testEnumsWant := []testEnum {testEnumFoo , testEnumBar }
743
+
744
+ ctx := context .Background ()
745
+ testCases := autoFlexTestCases {
746
+ {
747
+ TestName : "valid value" ,
748
+ Source : types .ListValueMust (types .StringType , []attr.Value {
749
+ types .StringValue (string (testEnumFoo )),
750
+ types .StringValue (string (testEnumBar )),
751
+ }),
752
+ Target : & testEnums ,
753
+ WantTarget : & testEnumsWant ,
754
+ },
755
+ {
756
+ TestName : "empty value" ,
757
+ Source : types .ListValueMust (types .StringType , []attr.Value {}),
758
+ Target : & testEnums ,
759
+ WantTarget : & testEnums ,
760
+ },
761
+ {
762
+ TestName : "null value" ,
763
+ Source : types .ListNull (types .StringType ),
764
+ Target : & testEnums ,
765
+ WantTarget : & testEnums ,
766
+ },
767
+ }
768
+ runAutoExpandTestCases (ctx , t , testCases )
769
+ }
770
+
771
+ func TestExpandSetOfStringEnum (t * testing.T ) {
772
+ t .Parallel ()
773
+
774
+ type testEnum string
775
+ var testEnumFoo testEnum = "foo"
776
+ var testEnumBar testEnum = "bar"
777
+
778
+ var testEnums []testEnum
779
+ testEnumsWant := []testEnum {testEnumFoo , testEnumBar }
780
+
781
+ ctx := context .Background ()
782
+ testCases := autoFlexTestCases {
783
+ {
784
+ TestName : "valid value" ,
785
+ Source : types .SetValueMust (types .StringType , []attr.Value {
786
+ types .StringValue (string (testEnumFoo )),
787
+ types .StringValue (string (testEnumBar )),
788
+ }),
789
+ Target : & testEnums ,
790
+ WantTarget : & testEnumsWant ,
791
+ },
792
+ {
793
+ TestName : "empty value" ,
794
+ Source : types .SetValueMust (types .StringType , []attr.Value {}),
795
+ Target : & testEnums ,
796
+ WantTarget : & testEnums ,
797
+ },
798
+ {
799
+ TestName : "null value" ,
800
+ Source : types .SetNull (types .StringType ),
801
+ Target : & testEnums ,
802
+ WantTarget : & testEnums ,
803
+ },
804
+ }
805
+ runAutoExpandTestCases (ctx , t , testCases )
806
+ }
807
+
734
808
func TestExpandSimpleNestedBlockWithStringEnum (t * testing.T ) {
735
809
t .Parallel ()
736
810
0 commit comments