@@ -6502,7 +6502,7 @@ func Test_panicOnErrUnparsableDefaultTrue(t *testing.T) {
65026502 os .Setenv (PanicOnErr , oldEnv )
65036503}
65046504
6505- func TestValidateAllOfAttributes (t * testing.T ) {
6505+ func TestValidateRequiredWithAttributes (t * testing.T ) {
65066506 cases := map [string ]struct {
65076507 Key string
65086508 Schema map [string ]* Schema
@@ -6514,14 +6514,14 @@ func TestValidateAllOfAttributes(t *testing.T) {
65146514 Key : "whitelist" ,
65156515 Schema : map [string ]* Schema {
65166516 "whitelist" : {
6517- Type : TypeBool ,
6518- Optional : true ,
6519- AllOf : []string {"blacklist" },
6517+ Type : TypeBool ,
6518+ Optional : true ,
6519+ RequiredWith : []string {"blacklist" },
65206520 },
65216521 "blacklist" : {
6522- Type : TypeBool ,
6523- Optional : true ,
6524- AllOf : []string {"whitelist" },
6522+ Type : TypeBool ,
6523+ Optional : true ,
6524+ RequiredWith : []string {"whitelist" },
65256525 },
65266526 },
65276527
@@ -6536,14 +6536,14 @@ func TestValidateAllOfAttributes(t *testing.T) {
65366536 Key : "whitelist" ,
65376537 Schema : map [string ]* Schema {
65386538 "whitelist" : {
6539- Type : TypeBool ,
6540- Optional : true ,
6541- AllOf : []string {"blacklist" },
6539+ Type : TypeBool ,
6540+ Optional : true ,
6541+ RequiredWith : []string {"blacklist" },
65426542 },
65436543 "blacklist" : {
6544- Type : TypeBool ,
6545- Optional : true ,
6546- AllOf : []string {"whitelist" },
6544+ Type : TypeBool ,
6545+ Optional : true ,
6546+ RequiredWith : []string {"whitelist" },
65476547 },
65486548 },
65496549
@@ -6557,14 +6557,14 @@ func TestValidateAllOfAttributes(t *testing.T) {
65576557 Key : "whitelist" ,
65586558 Schema : map [string ]* Schema {
65596559 "whitelist" : {
6560- Type : TypeBool ,
6561- Optional : true ,
6562- AllOf : []string {"blacklist" },
6560+ Type : TypeBool ,
6561+ Optional : true ,
6562+ RequiredWith : []string {"blacklist" },
65636563 },
65646564 "blacklist" : {
6565- Type : TypeBool ,
6566- Optional : true ,
6567- AllOf : []string {"whitelist" },
6565+ Type : TypeBool ,
6566+ Optional : true ,
6567+ RequiredWith : []string {"whitelist" },
65686568 },
65696569 },
65706570
@@ -6576,19 +6576,19 @@ func TestValidateAllOfAttributes(t *testing.T) {
65766576 Key : "whitelist" ,
65776577 Schema : map [string ]* Schema {
65786578 "whitelist" : {
6579- Type : TypeBool ,
6580- Optional : true ,
6581- AllOf : []string {"purplelist" },
6579+ Type : TypeBool ,
6580+ Optional : true ,
6581+ RequiredWith : []string {"purplelist" },
65826582 },
65836583 "blacklist" : {
6584- Type : TypeBool ,
6585- Optional : true ,
6586- AllOf : []string {"whitelist" , "purplelist" },
6584+ Type : TypeBool ,
6585+ Optional : true ,
6586+ RequiredWith : []string {"whitelist" , "purplelist" },
65876587 },
65886588 "purplelist" : {
6589- Type : TypeBool ,
6590- Optional : true ,
6591- AllOf : []string {"whitelist" },
6589+ Type : TypeBool ,
6590+ Optional : true ,
6591+ RequiredWith : []string {"whitelist" },
65926592 },
65936593 },
65946594
@@ -6603,19 +6603,19 @@ func TestValidateAllOfAttributes(t *testing.T) {
66036603 Key : "whitelist" ,
66046604 Schema : map [string ]* Schema {
66056605 "whitelist" : {
6606- Type : TypeBool ,
6607- Optional : true ,
6608- AllOf : []string {"blacklist" , "purplelist" },
6606+ Type : TypeBool ,
6607+ Optional : true ,
6608+ RequiredWith : []string {"blacklist" , "purplelist" },
66096609 },
66106610 "blacklist" : {
6611- Type : TypeBool ,
6612- Optional : true ,
6613- AllOf : []string {"whitelist" , "purplelist" },
6611+ Type : TypeBool ,
6612+ Optional : true ,
6613+ RequiredWith : []string {"whitelist" , "purplelist" },
66146614 },
66156615 "purplelist" : {
6616- Type : TypeBool ,
6617- Optional : true ,
6618- AllOf : []string {"whitelist" , "blacklist" },
6616+ Type : TypeBool ,
6617+ Optional : true ,
6618+ RequiredWith : []string {"whitelist" , "blacklist" },
66196619 },
66206620 },
66216621
@@ -6631,19 +6631,19 @@ func TestValidateAllOfAttributes(t *testing.T) {
66316631 Key : "whitelist" ,
66326632 Schema : map [string ]* Schema {
66336633 "whitelist" : {
6634- Type : TypeBool ,
6635- Optional : true ,
6636- AllOf : []string {"blacklist" , "purplelist" },
6634+ Type : TypeBool ,
6635+ Optional : true ,
6636+ RequiredWith : []string {"blacklist" , "purplelist" },
66376637 },
66386638 "blacklist" : {
6639- Type : TypeBool ,
6640- Optional : true ,
6641- AllOf : []string {"whitelist" , "purplelist" },
6639+ Type : TypeBool ,
6640+ Optional : true ,
6641+ RequiredWith : []string {"whitelist" , "purplelist" },
66426642 },
66436643 "purplelist" : {
6644- Type : TypeBool ,
6645- Optional : true ,
6646- AllOf : []string {"whitelist" , "blacklist" },
6644+ Type : TypeBool ,
6645+ Optional : true ,
6646+ RequiredWith : []string {"whitelist" , "blacklist" },
66476647 },
66486648 },
66496649
@@ -6657,19 +6657,19 @@ func TestValidateAllOfAttributes(t *testing.T) {
66576657 Key : "whitelist" ,
66586658 Schema : map [string ]* Schema {
66596659 "whitelist" : {
6660- Type : TypeBool ,
6661- Optional : true ,
6662- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6660+ Type : TypeBool ,
6661+ Optional : true ,
6662+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
66636663 },
66646664 "blacklist" : {
6665- Type : TypeBool ,
6666- Optional : true ,
6667- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6665+ Type : TypeBool ,
6666+ Optional : true ,
6667+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
66686668 },
66696669 "purplelist" : {
6670- Type : TypeBool ,
6671- Optional : true ,
6672- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6670+ Type : TypeBool ,
6671+ Optional : true ,
6672+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
66736673 },
66746674 },
66756675
@@ -6680,19 +6680,19 @@ func TestValidateAllOfAttributes(t *testing.T) {
66806680 "Only Unknown Variable Value" : {
66816681 Schema : map [string ]* Schema {
66826682 "whitelist" : {
6683- Type : TypeBool ,
6684- Optional : true ,
6685- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6683+ Type : TypeBool ,
6684+ Optional : true ,
6685+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
66866686 },
66876687 "blacklist" : {
6688- Type : TypeBool ,
6689- Optional : true ,
6690- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6688+ Type : TypeBool ,
6689+ Optional : true ,
6690+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
66916691 },
66926692 "purplelist" : {
6693- Type : TypeBool ,
6694- Optional : true ,
6695- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6693+ Type : TypeBool ,
6694+ Optional : true ,
6695+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
66966696 },
66976697 },
66986698
@@ -6706,16 +6706,16 @@ func TestValidateAllOfAttributes(t *testing.T) {
67066706 "only unknown list value" : {
67076707 Schema : map [string ]* Schema {
67086708 "whitelist" : {
6709- Type : TypeList ,
6710- Optional : true ,
6711- Elem : & Schema {Type : TypeString },
6712- AllOf : []string {"whitelist" , "blacklist" },
6709+ Type : TypeList ,
6710+ Optional : true ,
6711+ Elem : & Schema {Type : TypeString },
6712+ RequiredWith : []string {"whitelist" , "blacklist" },
67136713 },
67146714 "blacklist" : {
6715- Type : TypeList ,
6716- Optional : true ,
6717- Elem : & Schema {Type : TypeString },
6718- AllOf : []string {"whitelist" , "blacklist" },
6715+ Type : TypeList ,
6716+ Optional : true ,
6717+ Elem : & Schema {Type : TypeString },
6718+ RequiredWith : []string {"whitelist" , "blacklist" },
67196719 },
67206720 },
67216721
@@ -6729,19 +6729,19 @@ func TestValidateAllOfAttributes(t *testing.T) {
67296729 "Unknown Variable Value and Known Value" : {
67306730 Schema : map [string ]* Schema {
67316731 "whitelist" : {
6732- Type : TypeBool ,
6733- Optional : true ,
6734- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6732+ Type : TypeBool ,
6733+ Optional : true ,
6734+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
67356735 },
67366736 "blacklist" : {
6737- Type : TypeBool ,
6738- Optional : true ,
6739- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6737+ Type : TypeBool ,
6738+ Optional : true ,
6739+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
67406740 },
67416741 "purplelist" : {
6742- Type : TypeBool ,
6743- Optional : true ,
6744- AllOf : []string {"whitelist" , "blacklist" , "purplelist" },
6742+ Type : TypeBool ,
6743+ Optional : true ,
6744+ RequiredWith : []string {"whitelist" , "blacklist" , "purplelist" },
67456745 },
67466746 },
67476747
0 commit comments