diff --git a/uni_modules/uts-tests/utssdk/Number.uts b/uni_modules/uts-tests/utssdk/Number.uts index 1c2234089d6d3ed42364a8bc4a3448d46b24b64e..1411f9662cb11d81b9db6302607398ddc35a7e51 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -125,6 +125,25 @@ export function testNumber() : Result { expect(Number.isInteger(-213123112.01)).toEqual(false); 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);