diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-04-05 00:28:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-05 00:28:27 +0300 |
commit | f834089925e39cdf786f07757308e14b57973542 (patch) | |
tree | 20b456de4b8d596f079109127ad3b9ad3011fa8f /t | |
parent | 140b9478dad5d19543c1cb4fd293ccec228f1240 (diff) | |
parent | 3dc0b7f0dcd10e9b10018e43d248d245b78bf9be (diff) |
Merge branch 'pw/wildmatch-fixes'
The wildmatch library code unlearns exponential behaviour it
acquired some time ago since it was borrowed from rsync.
* pw/wildmatch-fixes:
t3070: make chain lint tester happy
wildmatch: hide internal return values
wildmatch: avoid undefined behavior
wildmatch: fix exponential behavior
Diffstat (limited to 't')
-rwxr-xr-x | t/t3070-wildmatch.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh index 5d871fde96..4dd42df38c 100755 --- a/t/t3070-wildmatch.sh +++ b/t/t3070-wildmatch.sh @@ -431,4 +431,15 @@ match 1 1 1 1 'a' '[B-a]' match 0 1 0 1 'z' '[Z-y]' match 1 1 1 1 'Z' '[Z-y]' +test_expect_success 'matching does not exhibit exponential behavior' ' + { + test-tool wildmatch wildmatch \ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab \ + "*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a" & + pid=$! + } && + sleep 2 && + ! kill $! +' + test_done |