Skip to content

Commit 28e2fae

Browse files
authored
feat-fix: drop all now returns the basename as well (#1626)
* feat-fix: drop all now returns the basename as well * test-fix: update tests
1 parent 35ca678 commit 28e2fae

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/dataflow/internal/process/functions/call/built-in/built-in-source.ts

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export function findSource(seed: string, data: { referenceChain: readonly RParse
100100
case DropPathsOption.All: {
101101
const paths = platformDirname(seed).split(AnyPathSeparator);
102102
const basename = platformBasename(seed);
103+
tryPaths.push(basename);
103104
if(paths.length === 1 && paths[0] === '.') {
104105
break;
105106
}

test/functionality/slicing/configuration/source-finding.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ describe('source finding', () => {
5757
assertSourceFound('c.txt', ['c.txt']);
5858
assertSourceFound('b.txt', [`a${path.sep}b.txt`], [{ request: 'file', content: `a${path.sep}x.txt` }]);
5959
assertSourceFound('b.txt', [`x${path.sep}y${path.sep}z${path.sep}b.txt`], [{ request: 'file', content: `x${path.sep}y${path.sep}z${path.sep}g.txt` }]);
60-
assertSourceFound(`..${path.sep}b.txt`, [`x${path.sep}y${path.sep}b.txt`], [{ request: 'file', content: `x${path.sep}y${path.sep}z${path.sep}g.txt` }]);
60+
assertSourceFound(`..${path.sep}b.txt`, [`x${path.sep}y${path.sep}b.txt`, `x${path.sep}y${path.sep}z${path.sep}b.txt`], [{ request: 'file', content: `x${path.sep}y${path.sep}z${path.sep}g.txt` }]);
6161
assertSourceFound('with spaces.txt', ['with-spaces.txt']); // space replacements
6262
});

0 commit comments

Comments
 (0)