GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: cover path.basename when path and ext are the same · nodejs/node@b6cceae

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-path-basename.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-path-basename.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-path-basename.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ assert.strictEqual(path.basename('/aaa/'), 'aaa');
2929
assert.strictEqual(path.basename('/aaa/b'), 'b');
3030
assert.strictEqual(path.basename('/a/b'), 'b');
3131
assert.strictEqual(path.basename('//a'), 'a');
32+
assert.strictEqual(path.basename('a', 'a'), '');
3233

3334
// On Windows a backslash acts as a path separator.
3435
assert.strictEqual(path.win32.basename('\\dir\\basename.ext'), 'basename.ext');
@@ -53,6 +54,7 @@ assert.strictEqual(path.win32.basename('C:basename.ext\\'), 'basename.ext');
5354
assert.strictEqual(path.win32.basename('C:basename.ext\\\\'), 'basename.ext');
5455
assert.strictEqual(path.win32.basename('C:foo'), 'foo');
5556
assert.strictEqual(path.win32.basename('file:stream'), 'file:stream');
57+
assert.strictEqual(path.win32.basename('a', 'a'), '');
5658

5759
// On unix a backslash is just treated as any other character.
5860
assert.strictEqual(path.posix.basename('\\dir\\basename.ext'),

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.