mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-04 10:52:13 +02:00
test: split cli tests from source tree
This commit is contained in:
parent
7d79d4e38e
commit
4619217804
496 changed files with 2582 additions and 952 deletions
|
|
@ -1,26 +0,0 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
import { defaultLaneCandidatePoolLimit, normalizeSearchQuery } from './query.js';
|
||||
|
||||
describe('search query helpers', () => {
|
||||
it('normalizes punctuation and duplicate terms into stable lowercase tokens', () => {
|
||||
expect(normalizeSearchQuery(' Gross-Revenue, gross_revenue! Paid orders ')).toEqual({
|
||||
raw: ' Gross-Revenue, gross_revenue! Paid orders ',
|
||||
normalized: 'gross revenue gross_revenue paid orders',
|
||||
terms: ['gross', 'revenue', 'gross_revenue', 'paid', 'orders'],
|
||||
});
|
||||
});
|
||||
|
||||
it('returns an empty normalized query for punctuation-only input', () => {
|
||||
expect(normalizeSearchQuery('--- ///')).toEqual({
|
||||
raw: '--- ///',
|
||||
normalized: '',
|
||||
terms: [],
|
||||
});
|
||||
});
|
||||
|
||||
it('sizes per-lane candidate pools before final limiting', () => {
|
||||
expect(defaultLaneCandidatePoolLimit(1)).toBe(25);
|
||||
expect(defaultLaneCandidatePoolLimit(8)).toBe(25);
|
||||
expect(defaultLaneCandidatePoolLimit(10)).toBe(30);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue