Skip to content

Commit 10968ea

Browse files
committed
improve test for .. eating drive letters
Verify that it also doesn't eat them when it's a UNC path
1 parent 693c823 commit 10968ea

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/optimization-level-2.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,16 @@ t.test('do not eat the drive letter on Windows', t => {
143143
})
144144
// drive letters are a root on Windows
145145
t.equal(mw1.match('C:/../public/secret'), false)
146+
t.equal(mw1.match('//?/C:/../public/secret'), false)
146147
t.equal(mw2.match('C:/../public/secret'), false)
148+
t.equal(mw2.match('//?/C:/../public/secret'), false)
147149
// level 1 doesn't optimize out ..
148150
t.equal(mu1.match('C:/../public/secret'), false)
151+
// not special on unix, so this is just /?/C:/../public/secret
152+
t.equal(mu1.match('//?/C:/../public/secret'), false)
149153
// not special on unix systems, so .. eats the drive letter
150154
t.equal(mu2.match('C:/../public/secret'), true)
155+
// not special on unix, so this is just /?/C:/../public/secret
156+
t.equal(mu2.match('//?/C:/../public/secret'), false)
151157
t.end()
152158
})

0 commit comments

Comments
 (0)