提交 dd993444 编写于 作者: 杜庆泉's avatar 杜庆泉

补充 UTSNumber isNaN 测试示例

上级 5755b42b
...@@ -114,6 +114,14 @@ export function testNumber() : Result { ...@@ -114,6 +114,14 @@ export function testNumber() : Result {
test('isNaN', () => { test('isNaN', () => {
expect(isNaN(0)).toEqual(false); expect(isNaN(0)).toEqual(false);
let aj2 = JSON.parse('{"a":1}') as UTSJSONObject;
let aNumber = aj2['a'] as UTSNumber
expect(isNaN(aNumber)).toEqual(false);
expect(UTSNumber.isNaN(aNumber)).toEqual(false);
expect(UTSNumber.isNaN(11)).toEqual(false);
expect(UTSNumber.isNaN(null)).toEqual(false);
expect(UTSNumber.isNaN(1 / 0)).toEqual(false);
}) })
test('toPrecision', () => { test('toPrecision', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册