more tests
This commit is contained in:
@@ -70,3 +70,22 @@ describe("Misc: get folder levels", () => {
|
||||
expect(misc.getFolderLevels(item3)).to.deep.equal(res3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Misc: vaild file name tests", () => {
|
||||
it("should treat no ascii correctly", async () => {
|
||||
const x = misc.isVaildText("😄🍎 apple 苹果");
|
||||
// console.log(x)
|
||||
expect(x).to.be.true;
|
||||
});
|
||||
|
||||
it("should find not-printable chars correctly", async () => {
|
||||
const x = misc.isVaildText("😄🍎 apple 苹果\u0000");
|
||||
// console.log(x)
|
||||
expect(x).to.be.false;
|
||||
});
|
||||
|
||||
it("should allow spaces/slashes/...", async () => {
|
||||
const x = misc.isVaildText("😄🍎 apple 苹果/-_=/\\*%^&@#$`");
|
||||
expect(x).to.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user