From 5bdc1d612a9acf574aef7a729c4dad31f0bc1295 Mon Sep 17 00:00:00 2001 From: Trevor Burnham Date: Sun, 16 Feb 2025 18:39:52 -0500 Subject: [PATCH] test: Add test case for regression in npm/cli (#203) --- test/basic.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/basic.js b/test/basic.js index 6eb9737..d99c975 100644 --- a/test/basic.js +++ b/test/basic.js @@ -756,6 +756,17 @@ t.test('file: spec with non URI compatible components', t => { t.end() }) +t.test('file: spec with encoded URI components', t => { + t.has(normalizePaths(npa('file:/test_%23dir')), { + type: 'directory', + name: null, + rawSpec: 'file:/test_%23dir', + fetchSpec: '/test_#dir', + saveSpec: 'file:/test_#dir', + }) + t.end() +}) + t.test('directory cwd has non URI compatible components', t => { // eslint-disable-next-line max-len const where = '/tmp/ !"$%&\'()*+,-.0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'