mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-28 10:36:14 -04:00
feat(tool): text statistics
This commit is contained in:
parent
2f49631ff7
commit
0a7c3252e3
7 changed files with 67 additions and 1 deletions
14
src/tools/text-statistics/text-statistics.service.test.ts
Normal file
14
src/tools/text-statistics/text-statistics.service.test.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { expect, describe, it } from 'vitest';
|
||||
import { getStringSizeInBytes } from './text-statistics.service';
|
||||
|
||||
describe('text-statistics', () => {
|
||||
describe('getStringSizeInBytes', () => {
|
||||
it('should return the size of a string in bytes', () => {
|
||||
expect(getStringSizeInBytes('')).toEqual(0);
|
||||
expect(getStringSizeInBytes('a')).toEqual(1);
|
||||
expect(getStringSizeInBytes('aa')).toEqual(2);
|
||||
expect(getStringSizeInBytes('😀')).toEqual(4);
|
||||
expect(getStringSizeInBytes('aaaaaaaaaa')).toEqual(10);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue