mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { classifyReferenceSourcePath } from "./referenceSourceClassification.js";
|
|
|
|
describe("reference source manifest filenames", () => {
|
|
it.each(["CMakeLists.txt", "cmakelists.txt", "CMAKELISTS.TXT"])(
|
|
"recognizes %s with the existing case-insensitive policy",
|
|
(path) => {
|
|
expect(classifyReferenceSourcePath(path)).toEqual([
|
|
"documentation",
|
|
"manifest",
|
|
]);
|
|
},
|
|
);
|
|
|
|
it("preserves secondary classifications for a nested CMake manifest", () => {
|
|
expect(classifyReferenceSourcePath("src/CMakeLists.txt")).toEqual([
|
|
"documentation",
|
|
"manifest",
|
|
"source",
|
|
]);
|
|
});
|
|
|
|
it.each(["CMakeLists.txt.backup", "CMakeList.txt", "notes.txt"])(
|
|
"does not classify the near-match %s as a manifest",
|
|
(path) => {
|
|
expect(classifyReferenceSourcePath(path)).not.toContain("manifest");
|
|
},
|
|
);
|
|
|
|
it.each(["package.json", "PACKAGE.JSON", "Cargo.toml"])(
|
|
"preserves case-insensitive recognition of %s",
|
|
(path) => {
|
|
expect(classifyReferenceSourcePath(path)).toContain("manifest");
|
|
},
|
|
);
|
|
});
|