mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-10-09 08:56:12 +00:00
test(util): add comprehensive edge case coverage for brace expansion parsing
Co-authored-by: chenrui333 <1580956+chenrui333@users.noreply.github.com>
This commit is contained in:
parent
c619af70ff
commit
9963753aeb
1 changed files with 33 additions and 0 deletions
|
@ -444,3 +444,36 @@ describe('util', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseInputFiles edge cases', () => {
|
||||
it('handles multiple brace groups on same line', () => {
|
||||
assert.deepStrictEqual(parseInputFiles('./**/*.{exe,deb},./dist/**/*.{zip,tar.gz}'), [
|
||||
'./**/*.{exe,deb}',
|
||||
'./dist/**/*.{zip,tar.gz}',
|
||||
]);
|
||||
});
|
||||
|
||||
it('handles nested braces', () => {
|
||||
assert.deepStrictEqual(parseInputFiles('path/{a,{b,c}}/file.txt'), ['path/{a,{b,c}}/file.txt']);
|
||||
});
|
||||
|
||||
it('handles empty comma-separated values', () => {
|
||||
assert.deepStrictEqual(parseInputFiles('foo,,bar'), ['foo', 'bar']);
|
||||
});
|
||||
|
||||
it('handles commas with spaces around braces', () => {
|
||||
assert.deepStrictEqual(parseInputFiles(' ./**/*.{exe,deb} , file.txt '), [
|
||||
'./**/*.{exe,deb}',
|
||||
'file.txt',
|
||||
]);
|
||||
});
|
||||
|
||||
it('handles mixed newlines and commas with braces', () => {
|
||||
assert.deepStrictEqual(parseInputFiles('file1.txt\n./**/*.{exe,deb},file2.txt\nfile3.txt'), [
|
||||
'file1.txt',
|
||||
'./**/*.{exe,deb}',
|
||||
'file2.txt',
|
||||
'file3.txt',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue