From 5e8f2cb3b5f1cf78c3504b30705c9996c305389a Mon Sep 17 00:00:00 2001 From: m0_75226990 Date: Thu, 21 Dec 2023 16:48:07 +0800 Subject: [PATCH] =?UTF-8?q?iOS=E6=96=B0=E5=A2=9EinstanceTest=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uts-advance/utssdk/app-ios/index.uts | 17 +++++++++++++++++ uni_modules/uts-tests/utssdk/Number.uts | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/uni_modules/uts-advance/utssdk/app-ios/index.uts b/uni_modules/uts-advance/utssdk/app-ios/index.uts index 49a201e..2497c1a 100644 --- a/uni_modules/uts-advance/utssdk/app-ios/index.uts +++ b/uni_modules/uts-advance/utssdk/app-ios/index.uts @@ -214,3 +214,20 @@ export function logFunctionTest(){ } console.log(testFun) } + + +export class User { + + private name : string; + private age : Int; + + constructor(hostP : string, port : Int) { + this.name = hostP; + this.age = port; + } + + describeSelf():string{ + let text = "name = " + this.name + ";age = " + `${this.age}` + return text + } +} \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/Number.uts b/uni_modules/uts-tests/utssdk/Number.uts index 302dbe2..8e76241 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -88,6 +88,12 @@ export function testNumber() : Result { expect((-10.22).toString(8)).toEqual("-12.16050753412172704"); expect((123456789987654).toString(16)).toEqual("7048861cc146"); expect((-0xff).toString(2)).toEqual("-11111111"); + const a = 1e38 + expect(a.toString(16)).toEqual("4b3b4ca85a86c4000000000000000000"); + expect(a.toString(2)).toEqual("1001011001110110100110010101000010110101000011011000100000000000000000000000000000000000000000000000000000000000000000000000000") + const b = 1e22 + expect(b.toString(12)).toEqual("27373a86ba1a194a65054"); + }) test('valueOf', () => { -- GitLab