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

新增UTSNumber 单目运算符测试用例

上级 ad6a99a6
......@@ -126,6 +126,25 @@ export function testNumber() : Result {
expect(Number.isInteger(-213123112)).toEqual(true);
})
test('Unary-Operators', () => {
let a = JSON.parse("1") as Number
a++;
expect(a.toString()).toEqual("2");
a--;
expect(a.toString()).toEqual("1");
a /= 0.5;
expect(a.toString()).toEqual("2");
a *= 5;
expect(a.toString()).toEqual("10");
a += -1;
expect(a.toString()).toEqual("9");
a -= -2;
expect(a.toString()).toEqual("11");
let a2 = a % 5
expect(a2.toString()).toEqual("1");
})
test('isNaN', () => {
expect(isNaN(0)).toEqual(false);
// #ifdef APP-ANDROID
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册