Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/spec/FileUtils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ define(function (require, exports, module) {
});
});

describe("convertToNativePath", function () {
it("should convert windows URL syntax to Windows native path.", function () {
expect(FileUtils.convertToNativePath("/C:/foo/bar/baz.txt")).toBe("C:/foo/bar/baz.txt");
});

it("should not modify a windows non-URL path syntax.", function () {
expect(FileUtils.convertToNativePath("C:/foo/bar/baz.txt")).toBe("C:/foo/bar/baz.txt");
});

it("should not modify a posix path.", function () {
expect(FileUtils.convertToNativePath("/foo/bar/baz.txt")).toBe("/foo/bar/baz.txt");
expect(FileUtils.convertToNativePath("foo/bar/baz.txt")).toBe("foo/bar/baz.txt");
expect(FileUtils.convertToNativePath("/foo/bar/")).toBe("/foo/bar/");
expect(FileUtils.convertToNativePath("foo/bar/")).toBe("foo/bar/");
});
});

describe("getDirectoryPath", function () {

it("should get the parent directory of a normalized win file path", function () {
Expand Down