From 5f2f5ee1e438e8a64220682fe6751651ca36be10 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Fri, 20 Mar 2026 19:56:02 +0900 Subject: [PATCH] @actions/glob: add some comments for the regression testing Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- __tests__/internal-pattern.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/__tests__/internal-pattern.test.ts b/__tests__/internal-pattern.test.ts index 1c52543..2f101d9 100644 --- a/__tests__/internal-pattern.test.ts +++ b/__tests__/internal-pattern.test.ts @@ -342,6 +342,13 @@ describe('pattern', () => { expect(pattern.match('C:/foo/b/ar/baz')).toBeTruthy() // Regression testing for minimatch v3 + // Historically, minimatch/glob had a bug when parsing a character class + // containing an escaped '!' (e.g. `[\\!]`). In some cases, the internal + // pattern construction would incorrectly insert the literal string + // "undefined" into the generated pattern/segment, which could make a + // pattern intended to match `b[\\!]r` also match a path segment like + // `b[undefined/!]r`. This test ensures that a pattern with a literal + // `[\\!]` in the directory name does *not* match such malformed paths. pattern = new Pattern('C:/foo/b[\\!]r/b*') expect(pattern.searchPath).toBe('C:\\foo\\b[\\!]r') expect(pattern.match('C:/foo/b[undefined/!]r/baz')).toBeFalsy()