parent
ecd0e50ac4
commit
5f9e8f5b7e
7 changed files with 437 additions and 14 deletions
|
@ -535,4 +535,18 @@ describe("Zotero.File", function () {
|
|||
assert.equal(contents, 'Hello Zotero\n');
|
||||
});
|
||||
});
|
||||
|
||||
describe("#normalizeToUnix()", function () {
|
||||
it("should normalize a Unix-style path", async function () {
|
||||
assert.equal(Zotero.File.normalizeToUnix('/path/to/directory/'), '/path/to/directory');
|
||||
});
|
||||
|
||||
it("should normalize '.' and '..'", async function () {
|
||||
assert.equal(Zotero.File.normalizeToUnix('/path/./to/some/../file'), '/path/to/file');
|
||||
});
|
||||
|
||||
it("should replace backslashes with forward slashes and trim trailing", async function () {
|
||||
assert.equal(Zotero.File.normalizeToUnix('C:\\Zotero\\Some\\Directory\\'), 'C:/Zotero/Some/Directory');
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue