@matheusbsbs / matheus-bagliano / commits / 732f934408
Fork 0

t1300: add test for urlmatch with multiple wildcards

Our urlmatch code handles multiple wildcards, but we don't currently have a test that checks this code path. Add a test that we handle this case correctly to avoid any regressions. Signed-off-by: brian m. carlson <bk2204@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Feb 20, 2020 at 02:24 UTC 732f93440831a9253ad5b9bd16a81e25e1901f22
1 file changed +6
t/t1300-config.sh
+6
@@ -1408,6 +1408,8 @@ test_expect_success 'urlmatch favors more specific URLs' '
1408 cookieFile = /tmp/wildcard.txt
1409 [http "https://*.example.com/wildcardwithsubdomain"]
1410 cookieFile = /tmp/wildcardwithsubdomain.txt
1411 + [http "https://*.example.*"]
1412 + cookieFile = /tmp/multiwildcard.txt
1413 [http "https://trailing.example.com"]
1414 cookieFile = /tmp/trailing.txt
1415 [http "https://user@*.example.com/"]
@@ -1454,6 +1456,10 @@ test_expect_success 'urlmatch favors more specific URLs' '
1456
1457 echo http.cookiefile /tmp/sub.txt >expect &&
1458 git config --get-urlmatch HTTP https://user@sub.example.com >actual &&
1459 + test_cmp expect actual &&
1460 +
1461 + echo http.cookiefile /tmp/multiwildcard.txt >expect &&
1462 + git config --get-urlmatch HTTP https://wildcard.example.org >actual &&
1463 test_cmp expect actual
1464 '
1465