Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions review-enrichment/test/history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,20 @@ test("requirementTokens drops short words and stopwords", () => {
]);
});

test("requirementTokens deduplicates case-insensitively", () => {
// Repeated words (any case) collapse to one token — the existing test has no repeats.
assert.deepEqual(requirementTokens("Cache cache CACHE storage"), ["cache", "storage"]);
});

test("requirementTokens drops a long-enough stopword via the stopword set, not the length floor", () => {
// `feature`/`should`/`support` are >= the 4-char floor, so they're dropped by the stopword check itself.
assert.deepEqual(requirementTokens("this feature should support caching"), ["caching"]);
});

test("requirementTokens keeps alphanumeric tokens and splits on punctuation", () => {
assert.deepEqual(requirementTokens("oauth2 retry-loop"), ["oauth2", "retry", "loop"]);
});

test("classifyCoverage thresholds", () => {
assert.equal(classifyCoverage("history analyzer enrichment", "history analyzer enrichment"), "full");
assert.equal(classifyCoverage("history analyzer enrichment", "history only"), "partial");
Expand Down
Loading