Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5abf93824d |
@@ -1703,6 +1703,31 @@ describe("backup album folders", () => {
|
|||||||
expect(readLedger(outDir).files["5"]).toMatchObject({ attempts: 2 });
|
expect(readLedger(outDir).files["5"]).toMatchObject({ attempts: 2 });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// The extension of this title is 303 bytes, so the ID cannot go before
|
||||||
|
// it, and the whole title is cut short with the ID at its end. The
|
||||||
|
// extension holds a "-", so the original is saved with `.bin`, a name
|
||||||
|
// that fits.
|
||||||
|
it("cuts a title short, extension and all, when its extension leaves no room for the ID", async () => {
|
||||||
|
const outDir = join(root, "backup");
|
||||||
|
const lib = libraryOf([
|
||||||
|
{
|
||||||
|
collection: collection(10, "Trip"),
|
||||||
|
files: [file(1, 10, `a.${"L".repeat(300)}-x`)],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
const result = await runBackup(lib, { downloadDirectory: outDir });
|
||||||
|
|
||||||
|
const link = `a.${"L".repeat(249)} (1)`;
|
||||||
|
expect(Buffer.byteLength(link)).toBe(255);
|
||||||
|
expect(result.failed).toBe(0);
|
||||||
|
expect(tree(outDir)).toEqual([
|
||||||
|
"Trip/",
|
||||||
|
`Trip/${link} -> ${linkTo("1.bin")}`,
|
||||||
|
"Trip.json",
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
// The user has put a file in collections/ with the name of the album
|
// The user has put a file in collections/ with the name of the album
|
||||||
// Trip's folder, so the folder cannot be made.
|
// Trip's folder, so the folder cannot be made.
|
||||||
it("goes on to the next album when an album's folder cannot be made, and lists it as failed", async () => {
|
it("goes on to the next album when an album's folder cannot be made, and lists it as failed", async () => {
|
||||||
|
|||||||
Reference in new issue
Block a user