diff --git a/uni_modules/uts-tests/utssdk/JSON.uts b/uni_modules/uts-tests/utssdk/JSON.uts index 6161f2542175ced7290dc75f527472eab4669885..0bb9c93d3045b1bd0e68e30750c37581c6b3ef64 100644 --- a/uni_modules/uts-tests/utssdk/JSON.uts +++ b/uni_modules/uts-tests/utssdk/JSON.uts @@ -279,6 +279,19 @@ export function testJSON() : Result { console.log(retStr) }) + test('UTSJSONOject', () => { + //var t1 = "1" + //const a = { + // test(){ + // t1 = "2" + // console.log("test") + // } + //} + //(a['test'] as ()=>void)() + //console.log(a['test']) + //expect(t1).toEqual("2") + }) + }) diff --git a/uni_modules/uts-tests/utssdk/Number.uts b/uni_modules/uts-tests/utssdk/Number.uts index ca405a9095ff95646f28e770fd94e95438a280ce..3d9fda50c0bcdb5361e6bfc2d121ac054fad1946 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -38,6 +38,21 @@ export function testNumber(): Result { expect(a2.toShort().toFixed(5)).toEqual("-122.00000"); // #endif + /** + * add since 2023-11-21 + * 发现部分场景在android 6 以下与web有差异,新增以下示例 + */ + let r = 2.449999999999999999; + let t1 = r.toFixed(1); + expect(t1).toEqual("2.5"); + + let r2 = 2.4499999999999999; + let t2 = r2.toFixed(1); + expect(t2).toEqual("2.4"); + + let r3 = -9007199254740991; + let t3 = r3.toFixed(15); + expect(t3).toEqual("-9007199254740991.000000000000000"); })