fix(reference): recognize CMake build manifests (#665)

This commit is contained in:
Kaoru0822
2026-10-06 16:17:50 +08:00
committed by GitHub
parent 217e8cf59f
commit 1a24be574d
3 changed files with 73 additions and 1 deletions
@@ -0,0 +1,37 @@
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");
},
);
});