HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/nodejs/@nodelib/fs.scandir/out/providers/common.spec.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const common = require("./common");
describe('Readers → Common', () => {
    describe('.joinPathSegments', () => {
        it('should return concatenated string', () => {
            assert.strictEqual(common.joinPathSegments('.', 'a', '/'), './a');
        });
        it('should return correct string when the first segment ens with the separator symbol', () => {
            // Unix
            assert.strictEqual(common.joinPathSegments('/', 'a', '/'), '/a');
            assert.strictEqual(common.joinPathSegments('//', 'a', '/'), '//a');
            assert.strictEqual(common.joinPathSegments('/a/', 'b', '/'), '/a/b');
            // Windows
            assert.strictEqual(common.joinPathSegments('C:/', 'Users', '/'), 'C:/Users');
            assert.strictEqual(common.joinPathSegments('C:\\', 'Users', '\\'), 'C:\\Users');
            assert.strictEqual(common.joinPathSegments('//?/C:/', 'Users', '/'), '//?/C:/Users');
            assert.strictEqual(common.joinPathSegments('\\\\?\\C:\\', 'Users', '\\'), '\\\\?\\C:\\Users');
        });
    });
});