This repository has been archived on 2026-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
nyx/node_modules/path-browserify/test/test-path-dirname.js
Nico e2667f8e12 Initial nyx project — fork of hermes-frontend
Forked from hermes-frontend, stripped openclaw/bun specifics:
- Auth tokens: openclaw_session -> nyx_session
- Vite proxy: localhost:3003 -> localhost:8000 (assay)
- Prod WS: wss://assay.loop42.de/ws
- Workspace paths: removed openclaw-specific paths
- Added missing deps: @heroicons/vue, overlayscrollbars-vue
- Branding: title -> nyx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:23:27 +02:00

59 lines
2.7 KiB
JavaScript

'use strict';
var tape = require('tape');
var path = require('../');
tape('path.posix.dirname', function (t) {
t.strictEqual(path.posix.dirname('/a/b/'), '/a');
t.strictEqual(path.posix.dirname('/a/b'), '/a');
t.strictEqual(path.posix.dirname('/a'), '/');
t.strictEqual(path.posix.dirname(''), '.');
t.strictEqual(path.posix.dirname('/'), '/');
t.strictEqual(path.posix.dirname('////'), '/');
t.strictEqual(path.posix.dirname('//a'), '//');
t.strictEqual(path.posix.dirname('foo'), '.');
t.end();
});
tape('path.win32.dirname', { skip: true }, function (t) {
t.strictEqual(path.win32.dirname('c:\\'), 'c:\\');
t.strictEqual(path.win32.dirname('c:\\foo'), 'c:\\');
t.strictEqual(path.win32.dirname('c:\\foo\\'), 'c:\\');
t.strictEqual(path.win32.dirname('c:\\foo\\bar'), 'c:\\foo');
t.strictEqual(path.win32.dirname('c:\\foo\\bar\\'), 'c:\\foo');
t.strictEqual(path.win32.dirname('c:\\foo\\bar\\baz'), 'c:\\foo\\bar');
t.strictEqual(path.win32.dirname('\\'), '\\');
t.strictEqual(path.win32.dirname('\\foo'), '\\');
t.strictEqual(path.win32.dirname('\\foo\\'), '\\');
t.strictEqual(path.win32.dirname('\\foo\\bar'), '\\foo');
t.strictEqual(path.win32.dirname('\\foo\\bar\\'), '\\foo');
t.strictEqual(path.win32.dirname('\\foo\\bar\\baz'), '\\foo\\bar');
t.strictEqual(path.win32.dirname('c:'), 'c:');
t.strictEqual(path.win32.dirname('c:foo'), 'c:');
t.strictEqual(path.win32.dirname('c:foo\\'), 'c:');
t.strictEqual(path.win32.dirname('c:foo\\bar'), 'c:foo');
t.strictEqual(path.win32.dirname('c:foo\\bar\\'), 'c:foo');
t.strictEqual(path.win32.dirname('c:foo\\bar\\baz'), 'c:foo\\bar');
t.strictEqual(path.win32.dirname('file:stream'), '.');
t.strictEqual(path.win32.dirname('dir\\file:stream'), 'dir');
t.strictEqual(path.win32.dirname('\\\\unc\\share'),
'\\\\unc\\share');
t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo'),
'\\\\unc\\share\\');
t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\'),
'\\\\unc\\share\\');
t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar'),
'\\\\unc\\share\\foo');
t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar\\'),
'\\\\unc\\share\\foo');
t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'),
'\\\\unc\\share\\foo\\bar');
t.strictEqual(path.win32.dirname('/a/b/'), '/a');
t.strictEqual(path.win32.dirname('/a/b'), '/a');
t.strictEqual(path.win32.dirname('/a'), '/');
t.strictEqual(path.win32.dirname(''), '.');
t.strictEqual(path.win32.dirname('/'), '/');
t.strictEqual(path.win32.dirname('////'), '/');
t.strictEqual(path.win32.dirname('foo'), '.');
t.end();
});