UNPKG

838 BJavaScriptView Raw
1
2import { code2uni, uni2code, uni2hex, uni2fsw, uni2swu, fsw2uni, swu2uni } from './';
3
4
5it('should convert unicode code point to uni8 character', () => {
6 expect(code2uni(0x1D800)).toBe('𝠀');
7})
8
9it('should convert uni8 character to unicode code point', () => {
10 expect(uni2code('𝠀')).toBe(0x1D800);
11})
12
13it('should convert uni8 character to hex representation', () => {
14 expect(uni2hex('𝠀')).toBe('1D800');
15})
16
17it('should convert uni8 character to fsw', () => {
18 expect(uni2fsw('𝠀')).toBe('S10000');
19})
20
21it('should convert uni8 character to swu', () => {
22 expect(uni2swu('𝠀')).toBe('񀀁');
23})
24
25it('should convert fsw to uni8 character', () => {
26 expect(fsw2uni('S10000')).toBe('𝠀');
27})
28
29it('should convert swu to uni8 character', () => {
30 expect(swu2uni('񀀁')).toBe('𝠀');
31})