Automatically relink attachments from LABD (#2374)

Fixes #2092
This commit is contained in:
Abe Jellinek 2022-03-01 11:34:46 -08:00
parent ecd0e50ac4
commit 5f9e8f5b7e
7 changed files with 437 additions and 14 deletions

View file

@ -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');
});
});
})