diff --git a/uni_modules/uts-advance/utssdk/app-android/index.uts b/uni_modules/uts-advance/utssdk/app-android/index.uts index 52a2675f073cbe8a91ba189ed50ce12515e22e65..a1746d973ac05668537e116bfde63cf3a45c4ea1 100644 --- a/uni_modules/uts-advance/utssdk/app-android/index.uts +++ b/uni_modules/uts-advance/utssdk/app-android/index.uts @@ -22,9 +22,6 @@ import AlertDialog from 'android.app.AlertDialog'; import DialogInterface from 'android.content.DialogInterface'; import EditText from 'android.widget.EditText'; -import { - UTSAndroid -} from "io.dcloud.uts"; import array from 'android.R.array'; import File from 'java.io.File'; diff --git a/uni_modules/uts-platform-api/utssdk/app-android/index.uts b/uni_modules/uts-platform-api/utssdk/app-android/index.uts index 3a922c65d84ffc86a7da651332367f8863d073ee..6d5aa1562f8a50c658e2a4f4634186371e2722c3 100644 --- a/uni_modules/uts-platform-api/utssdk/app-android/index.uts +++ b/uni_modules/uts-platform-api/utssdk/app-android/index.uts @@ -1,6 +1,3 @@ -import { - UTSAndroid -} from "io.dcloud.uts"; import MediaStore from "android.provider.MediaStore"; import Activity from "android.app.Activity"; import Bitmap from "android.graphics.Bitmap"; diff --git a/uni_modules/uts-tests/utssdk/Date.uts b/uni_modules/uts-tests/utssdk/Date.uts index 346566128040fb53423bf161351971107062196b..d5c734b6723fbef325715c17a555b7a76ab1c047 100644 --- a/uni_modules/uts-tests/utssdk/Date.uts +++ b/uni_modules/uts-tests/utssdk/Date.uts @@ -10,6 +10,19 @@ export function testDate() : Result { expect(secondsElapsed).toEqual(2); }, 2000) }) + test('valueOf', () => { + const date1 = new Date('December 17, 1995 03:24:00'); + expect(date1.valueOf()).toEqual(819141840000); + const date2 = new Date('1995-12-17T03:24:00'); + expect(date2.valueOf()).toEqual(819141840000); + }) + test('parse', () => { + const unixTimeZero = Date.parse('01 Jan 1970 00:00:00 GMT'); + const javaScriptRelease = Date.parse('04 Dec 1995 00:12:00 GMT'); + + expect(unixTimeZero.toString()).toEqual("Thu Jan 01 1970 08:00:00 GMT+0800"); + expect(javaScriptRelease.toString()).toEqual("Mon Dec 04 1995 08:12:00 GMT+0800"); + }) test('getDate', () => { const birthday = new Date('August 19, 1975 23:15:30'); const date1 = birthday.getDate(); diff --git a/uni_modules/uts-tests/utssdk/Math.uts b/uni_modules/uts-tests/utssdk/Math.uts index 1f5aa0de3fea831b6e9459101a94506c0e22063e..93ec652ec94bb023e757203882c07172e20c55df 100644 --- a/uni_modules/uts-tests/utssdk/Math.uts +++ b/uni_modules/uts-tests/utssdk/Math.uts @@ -236,5 +236,10 @@ export function testMath(): Result { expect(Math.trunc(42.84)).toEqual(42); expect(Math.trunc(0.123)).toEqual(0); }) + test('round', () => { + expect(Math.round(0.9)).toEqual(1); + expect(Math.round(5.95)).toEqual(6); + expect(Math.round(-5.05)).toEqual(-5); + }) }) }