mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Perf: improve processLine performance
This commit is contained in:
21
Build/lib/process-line.test.ts
Normal file
21
Build/lib/process-line.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user