mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Add a basic stringToUTF16HexString
unit-test
This commit is contained in:
parent
9adc7859c8
commit
7d029f8bfe
1 changed files with 13 additions and 0 deletions
|
@ -23,6 +23,7 @@ import {
|
|||
isWhiteSpace,
|
||||
log2,
|
||||
parseXFAPath,
|
||||
stringToUTF16HexString,
|
||||
stringToUTF16String,
|
||||
toRomanNumerals,
|
||||
validateCSSFont,
|
||||
|
@ -355,6 +356,18 @@ describe("core_utils", function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe("stringToUTF16HexString", function () {
|
||||
it("should encode a string in UTF16 hexadecimal format", function () {
|
||||
expect(stringToUTF16HexString("hello world")).toEqual(
|
||||
"00680065006c006c006f00200077006f0072006c0064"
|
||||
);
|
||||
|
||||
expect(stringToUTF16HexString("こんにちは世界の")).toEqual(
|
||||
"30533093306b3061306f4e16754c306e"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("stringToUTF16String", function () {
|
||||
it("should encode a string in UTF16", function () {
|
||||
expect(stringToUTF16String("hello world")).toEqual(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue