@@ -79,6 +79,60 @@ func Test_CompareOptionForRuleConditions(t *testing.T) {
7979 },
8080 expected : true ,
8181 },
82+ {
83+ name : "equal - regex path pattern with AWS-mirrored top-level RegexValues" ,
84+ desiredRuleCondition : []types.RuleCondition {
85+ {
86+ Field : awssdk .String ("host-header" ),
87+ HostHeaderConfig : & types.HostHeaderConditionConfig {
88+ Values : []string {"example.com" },
89+ },
90+ },
91+ {
92+ Field : awssdk .String ("path-pattern" ),
93+ PathPatternConfig : & types.PathPatternConditionConfig {
94+ RegexValues : []string {"^/api/v1/.*" },
95+ },
96+ },
97+ },
98+ actualRuleCondition : []types.RuleCondition {
99+ {
100+ Field : awssdk .String ("host-header" ),
101+ HostHeaderConfig : & types.HostHeaderConditionConfig {
102+ Values : []string {"example.com" },
103+ },
104+ },
105+ {
106+ Field : awssdk .String ("path-pattern" ),
107+ PathPatternConfig : & types.PathPatternConditionConfig {
108+ RegexValues : []string {"^/api/v1/.*" },
109+ },
110+ RegexValues : []string {"^/api/v1/.*" },
111+ },
112+ },
113+ expected : true ,
114+ },
115+ {
116+ name : "not equal - different regex path pattern" ,
117+ desiredRuleCondition : []types.RuleCondition {
118+ {
119+ Field : awssdk .String ("path-pattern" ),
120+ PathPatternConfig : & types.PathPatternConditionConfig {
121+ RegexValues : []string {"^/api/v1/.*" },
122+ },
123+ },
124+ },
125+ actualRuleCondition : []types.RuleCondition {
126+ {
127+ Field : awssdk .String ("path-pattern" ),
128+ PathPatternConfig : & types.PathPatternConditionConfig {
129+ RegexValues : []string {"^/api/v2/.*" },
130+ },
131+ RegexValues : []string {"^/api/v2/.*" },
132+ },
133+ },
134+ expected : false ,
135+ },
82136 }
83137
84138 for _ , tc := range testCase {
0 commit comments