@@ -127,11 +127,43 @@ public void testKeyMatch4Func() {
127127
128128 @ Test
129129 public void testKeyMatch5Func () {
130+ testKeyMatch5 ("/alice_data/hello/123" , "/alice_data/{resource}/.*" , true );
131+
130132 testKeyMatch5 ("/parent/child?status=1&type=2" , "/parent/child" , true );
131133 testKeyMatch5 ("/parent?status=1&type=2" , "/parent/child" , false );
134+
132135 testKeyMatch5 ("/parent/child/?status=1&type=2" , "/parent/child/" , true );
133136 testKeyMatch5 ("/parent/child/?status=1&type=2" , "/parent/child" , false );
134137 testKeyMatch5 ("/parent/child?status=1&type=2" , "/parent/child/" , false );
138+
139+ testKeyMatch5 ("/foo" , "/foo" , true );
140+ testKeyMatch5 ("/foo" , "/foo*" , true );
141+ testKeyMatch5 ("/foo" , "/foo/*" , false );
142+ testKeyMatch5 ("/foo/bar" , "/foo" , false );
143+ testKeyMatch5 ("/foo/bar" , "/foo*" , false );
144+ testKeyMatch5 ("/foo/bar" , "/foo/*" , true );
145+ testKeyMatch5 ("/foobar" , "/foo" , false );
146+ testKeyMatch5 ("/foobar" , "/foo*" , false );
147+ testKeyMatch5 ("/foobar" , "/foo/*" , false );
148+
149+ testKeyMatch5 ("/" , "/{resource}" , false );
150+ testKeyMatch5 ("/resource1" , "/{resource}" , true );
151+ testKeyMatch5 ("/myid" , "/{id}/using/{resId}" , false );
152+ testKeyMatch5 ("/myid/using/myresid" , "/{id}/using/{resId}" , true );
153+
154+ testKeyMatch5 ("/proxy/myid" , "/proxy/{id}/*" , false );
155+ testKeyMatch5 ("/proxy/myid/" , "/proxy/{id}/*" , true );
156+ testKeyMatch5 ("/proxy/myid/res" , "/proxy/{id}/*" , true );
157+ testKeyMatch5 ("/proxy/myid/res/res2" , "/proxy/{id}/*" , true );
158+ testKeyMatch5 ("/proxy/myid/res/res2/res3" , "/proxy/{id}/*" , true );
159+ testKeyMatch5 ("/proxy/" , "/proxy/{id}/*" , false );
160+
161+ testKeyMatch5 ("/proxy/myid?status=1&type=2" , "/proxy/{id}/*" , false );
162+ testKeyMatch5 ("/proxy/myid/" , "/proxy/{id}/*" , true );
163+ testKeyMatch5 ("/proxy/myid/res?status=1&type=2" , "/proxy/{id}/*" , true );
164+ testKeyMatch5 ("/proxy/myid/res/res2?status=1&type=2" , "/proxy/{id}/*" , true );
165+ testKeyMatch5 ("/proxy/myid/res/res2/res3?status=1&type=2" , "/proxy/{id}/*" , true );
166+ testKeyMatch5 ("/proxy/" , "/proxy/{id}/*" , false );
135167 }
136168
137169 @ Test
0 commit comments