Skip to content

Commit

Permalink
Added tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
theodab committed Jul 16, 2024
1 parent 1fa7f34 commit 45783c4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/util/string_utils_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ function defineStringUtilTests() {
});
});

describe('htmlUnescape', () => {
it('handles special characters', () => {
expect(StringUtils.htmlUnescape('foo & bar')).toBe('foo & bar');
});

it('handles decimal special characters', () => {
expect(StringUtils.htmlUnescape('foo F bar')).toBe('foo F bar');
});

it('handles hex special characters', () => {
expect(StringUtils.htmlUnescape('foo D bar')).toBe('foo D bar');
});
});

it('converts toUTF8', () => {
const str = 'Xe\u4524\u1952';
const arr = [0x58, 0x65, 0xe4, 0x94, 0xa4, 0xe1, 0xa5, 0x92];
Expand Down

0 comments on commit 45783c4

Please sign in to comment.