18 lines
558 B
TypeScript
18 lines
558 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { headMd5, matchFileName } from "./hash.js";
|
|
|
|
describe("headMd5", () => {
|
|
it("md5 of sample", () => {
|
|
expect(headMd5(Buffer.from("abc"))).toBe("900150983cd24fb0d6963f7d28e17f72");
|
|
});
|
|
});
|
|
|
|
describe("matchFileName", () => {
|
|
it("strips folder and extension", () => {
|
|
expect(matchFileName("a/b/[Sub] Show - 01.mkv")).toBe("[Sub] Show - 01");
|
|
});
|
|
it("keeps dotfiles without extension strip", () => {
|
|
expect(matchFileName("a/.hidden")).toBe(".hidden");
|
|
});
|
|
});
|