From 9d5ae8e5ed4de3d33dc01daaf73f395774d0d579 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 11 Jul 2023 19:07:53 +0200 Subject: [PATCH] test: add regression test for path w/ trailing wildcard We decided to leave trailing `*` meaning the same as `**` because it was already in use. Original description: This patch demonstrates a corner case in the path glob matcher. Specifically, it documents how a single trailing asterisk is supposed to be treated as opposed to a double asterisk. With [[1]], a trailing `/*` is interpreted as an equivalent of `/**`. The commit add a case that shows that `/*` shouldn't be greedy as described in the docs [[2]][[3]]. See also the observations in the bug report ticket [[4]]. [1]: https://github.com/nedbat/coveragepy/commit/ec6205a8de972af6a09453235d02a7ebea6aea8e [2]: https://coverage.rtfd.io/en/stable/source.html#file-patterns [3]: https://coverage.rtfd.io/en/7.2.7/migrating.html#migrating-to-coverage-py-7-x [4]: https://github.com/nedbat/coveragepy/issues/1407#issuecomment-1631085209 --- tests/test_files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_files.py b/tests/test_files.py index 7424775b3..ae3a5e2b2 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -348,6 +348,7 @@ def test_glob_matcher(self) -> None: (self.make_file("sub/file1.py"), True), (self.make_file("sub/file2.c"), False), (self.make_file("sub2/file3.h"), True), + (self.make_file("sub2/sub/file3.h"), True), (self.make_file("sub3/file4.py"), True), (self.make_file("sub3/file5.c"), False), ]