Skip to content
Permalink
Browse files
fix!: Correct mishandled escaped path separators (#34)
Closes #32
  • Loading branch information
Trott committed May 3, 2021
1 parent aa91a48 commit 32f6d52663b7addac38d0dff570d8127edf03f47
Showing with 5 additions and 5 deletions.
  1. +1 −1 index.js
  2. +4 −4 test/index.test.js
@@ -6,7 +6,7 @@ var isWin32 = require('os').platform() === 'win32';

var slash = '/';
var backslash = /\\/g;
var enclosure = /[{[].*[}\]]$/;
var enclosure = /[{[].*\/.*[}\]]$/;
var globby = /(^|[^\\])([{[]|\([^)]+$)/;
var escaped = /\\([!*?|[\](){}])/g;

@@ -77,10 +77,10 @@ describe('glob-parent', function () {
'path/[foo bar]/subdir'
);
expect(gp('path/\\[bar]/')).toEqual('path/[bar]');
expect(gp('path/\\[bar]')).toEqual('path/[bar]');
expect(gp('path/\\[bar]')).toEqual('path');
expect(gp('[bar]')).toEqual('.');
expect(gp('[bar]/')).toEqual('.');
expect(gp('./\\[bar]')).toEqual('./[bar]');
expect(gp('./\\[bar]')).toEqual('.');
expect(gp('\\[bar]/')).toEqual('[bar]');
expect(gp('\\!dir/*')).toEqual('!dir');
expect(gp('[bar\\]/')).toEqual('.');
@@ -95,9 +95,9 @@ describe('glob-parent', function () {
expect(gp('foo-\\(bar\\).md')).toEqual('foo-');
} else {
expect(gp('foo-\\(bar\\).md')).toEqual('.');
expect(gp('\\[bar]')).toEqual('[bar]');
expect(gp('\\[bar]')).toEqual('.');
expect(gp('[bar\\]')).toEqual('.');
expect(gp('\\{foo,bar\\}')).toEqual('{foo,bar}');
expect(gp('\\{foo,bar\\}')).toEqual('.');
expect(gp('{foo,bar\\}')).toEqual('.');
}

0 comments on commit 32f6d52

Please sign in to comment.