mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-01-22 05:28:36 +01:00
15 lines
525 B
TypeScript
15 lines
525 B
TypeScript
import { filterOutDigits, extractNumbers } from 'src/support/stringFunctions';
|
|
|
|
test('filterOutDigits', async () => {
|
|
expect(filterOutDigits('')).toEqual('');
|
|
expect(filterOutDigits('a b c')).toEqual('a b c');
|
|
expect(filterOutDigits('a1b 2c 3')).toEqual('ab c ');
|
|
});
|
|
|
|
test('extractNumbers', async () => {
|
|
expect(extractNumbers('')).toEqual([]);
|
|
expect(extractNumbers('a b c')).toEqual([]);
|
|
expect(extractNumbers('a1b 2c 3')).toEqual([1, 2, 3]);
|
|
expect(extractNumbers('a12 21 304')).toEqual([12, 21, 304]);
|
|
});
|