![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/dceprojects.corals.io/node_modules/urix/test/ |
// Copyright 2014 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) var path = require("path") var assert = require("assert") var urix = require("../") "use stict" function test(testPath, expected) { path.sep = "\\" assert.equal(urix(testPath), expected) path.sep = "/" assert.equal(urix(testPath), testPath) } describe("urix", function() { it("is a function", function() { assert.equal(typeof urix, "function") }) it("converts backslashes to slashes", function() { test("a\\b\\c", "a/b/c") test("\\a\\b\\c", "/a/b/c") test("a/b\\c", "a/b/c") test("\\\\a\\\\\\b///c", "//a///b///c") }) it("changes the drive letter to a slash", function() { test("c:\\a", "/a") test("C:\\a", "/a") test("z:\\a", "/a") test("c:a", "/a") test("c:/a", "/a") test("c:\\\\a", "//a") test("c://a", "//a") test("c:\\//a", "///a") }) })