blob: aa1409a9a53323cab7a88c5e43d49ccb385ff46c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import { escapeChat, unescapeChat } from '../encoding';
describe('encode/decode', () => {
it('should escape special characters correctly', () => {
const input = '#&$%';
const expectedOutput = '<num><and><dollar><percent>';
expect(escapeChat(input)).toBe(expectedOutput);
});
it('should unescape special characters correctly', () => {
const input = '<num><and><dollar><percent>';
const expectedOutput = '#&$%';
expect(unescapeChat(input)).toBe(expectedOutput);
});
});
|