HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/design.system/node_modules/path-browserify/test/test-path-dirname.js
'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();
});