Perf: improve processLine performance

This commit is contained in:
SukkaW
2025-01-20 22:52:29 +08:00
parent 6cb410bc98
commit 1ce322a71c
3 changed files with 30 additions and 22 deletions

View File

@@ -0,0 +1,21 @@
import { describe, it } from 'mocha';
import { processLine } from './process-line';
import expect from 'expect';
describe('processLine', () => {
([
['! comment', null],
[' ! comment', null],
['// xommwnr', null],
['# comment', null],
[' # comment', null],
['###id', '###id'],
['##.class', '##.class'],
['## EOF', '## EOF']
] as const).forEach(([input, expected]) => {
it(input, () => {
expect(processLine(input)).toBe(expected);
});
});
});