1 // Copyright 2014 Simon Lydell
\r
2 // X11 (“MIT”) Licensed. (See LICENSE.)
\r
4 var path = require("path")
\r
5 var assert = require("assert")
\r
6 var urix = require("../")
\r
10 function test(testPath, expected) {
\r
12 assert.equal(urix(testPath), expected)
\r
14 assert.equal(urix(testPath), testPath)
\r
17 describe("urix", function() {
\r
19 it("is a function", function() {
\r
20 assert.equal(typeof urix, "function")
\r
24 it("converts backslashes to slashes", function() {
\r
25 test("a\\b\\c", "a/b/c")
\r
26 test("\\a\\b\\c", "/a/b/c")
\r
27 test("a/b\\c", "a/b/c")
\r
28 test("\\\\a\\\\\\b///c", "//a///b///c")
\r
32 it("changes the drive letter to a slash", function() {
\r
38 test("c:\\\\a", "//a")
\r
39 test("c://a", "//a")
\r
40 test("c:\\//a", "///a")
\r