diff --git a/test/unit/core_utils_spec.js b/test/unit/core_utils_spec.js index 41a16a0ed..f8fb8da16 100644 --- a/test/unit/core_utils_spec.js +++ b/test/unit/core_utils_spec.js @@ -22,6 +22,7 @@ import { isAscii, isWhiteSpace, log2, + numberToString, parseXFAPath, recoverJsURL, stringToUTF16HexString, @@ -182,6 +183,21 @@ describe("core_utils", function () { }); }); + describe("numberToString", function () { + it("should stringify integers", function () { + expect(numberToString(1)).toEqual("1"); + expect(numberToString(0)).toEqual("0"); + expect(numberToString(-1)).toEqual("-1"); + }); + + it("should stringify floats", function () { + expect(numberToString(1.0)).toEqual("1"); + expect(numberToString(1.2)).toEqual("1.2"); + expect(numberToString(1.23)).toEqual("1.23"); + expect(numberToString(1.234)).toEqual("1.23"); + }); + }); + describe("isWhiteSpace", function () { it("handles space characters", function () { expect(isWhiteSpace(0x20)).toEqual(true);