scroll/src/common/strings_test.ts

13 lines
447 B
JavaScript
Raw Normal View History

2023-11-03 11:59:58 -04:00
import { chars, importDefaultForRuntime, is_ascii, ITestBase } from './mod.ts';
2023-11-02 13:06:48 -04:00
2023-11-03 11:59:58 -04:00
const t: ITestBase = await importDefaultForRuntime('test_base');
2023-11-02 13:06:48 -04:00
2023-11-03 11:59:58 -04:00
t.test('chars fn properly splits strings into unicode characters', () => {
t.assertEquals(chars('😺😸😹'), ['😺', '😸', '😹']);
});
t.test('is_ascii properly descerns ascii chars', () => {
t.assertTrue(is_ascii('asjyverkjhsdf1928374'));
t.assertFalse(is_ascii('😺acalskjsdf'));
2023-11-02 13:06:48 -04:00
});