diff --git a/uni_modules/uts-tests/utssdk/Array.uts b/uni_modules/uts-tests/utssdk/Array.uts index 786072c263df27cc86f0424a664030591b9decd8..1bc62eebf163f02c5023f5b21b5d65bb41ac4235 100644 --- a/uni_modules/uts-tests/utssdk/Array.uts +++ b/uni_modules/uts-tests/utssdk/Array.uts @@ -278,7 +278,15 @@ export function testArray(): Result { expect(array1.unshift(4, 5)).toEqual(5); expect(array1).toEqual([4, 5, 1, 2, 3]); }) - + test("toString", () => { + const array1: number[] = [1, 2, 3]; + expect(array1.toString()).toEqual("1,2,3"); + const array2 = new Array() + array2.push("a") + array2.push("b") + array2.push("c") + expect(array2.toString()).toEqual("a,b,c"); + }) test('reverse', () => { // const array1: string[] = ['one', 'two', 'three']; // const reversed1: string[] = array1.reverse(); diff --git a/uni_modules/uts-tests/utssdk/Date.uts b/uni_modules/uts-tests/utssdk/Date.uts index d5c734b6723fbef325715c17a555b7a76ab1c047..0073f8b97ae3877ce2eeec1b8cef8eec91028728 100644 --- a/uni_modules/uts-tests/utssdk/Date.uts +++ b/uni_modules/uts-tests/utssdk/Date.uts @@ -23,6 +23,14 @@ export function testDate() : Result { 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('toTimeString', () => { + const date1 = new Date('01 Jan 1970 00:00:00 GMT'); + const date2 = new Date('December 17, 1995 03:24:00'); + + expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800"); + expect(date2.toTimeString()).toEqual("03:24: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/Map.uts b/uni_modules/uts-tests/utssdk/Map.uts index 76f71250f554418622dcaeb419a75d3951f3dec3..5da7d8a4c78be143090fc60d8e61dd5f3b94010a 100644 --- a/uni_modules/uts-tests/utssdk/Map.uts +++ b/uni_modules/uts-tests/utssdk/Map.uts @@ -58,12 +58,13 @@ export function testMap(): Result { expect(map3.get(333)).toEqual(333); // ios不支持链式调用 // myMap.set(1, 'foobar').set(2, 'baz'); - const map4 = new Map(); - const key1 = {}, key2 = {}; - map4.set(key1, '1') - map4.set(key2, '2') - expect(map4.get(key1)).toEqual('1'); - expect(map4.get(key2)).toEqual('2'); + // const map4 = new Map(); + // key 不支持对象 + // const key1 = {}, key2 = {}; + // map4.set(key1, '1') + // map4.set(key2, '2') + // expect(map4.get(key1)).toEqual('1'); + // expect(map4.get(key2)).toEqual('2'); const map5 = new Map([['key1', 'value1'], ['key2', 'value2']]); expect(map5.get('key1')).toEqual('value1'); expect(map5.get('key2')).toEqual('value2'); diff --git a/uni_modules/uts-tests/utssdk/Matchers.uts b/uni_modules/uts-tests/utssdk/Matchers.uts index 94b45f7fce9d76cbde202e95043918b1a2ae5b70..d51e8f03974a44cc9ab548e7ece67609244d5f91 100644 --- a/uni_modules/uts-tests/utssdk/Matchers.uts +++ b/uni_modules/uts-tests/utssdk/Matchers.uts @@ -9,7 +9,7 @@ export class Matchers { return } // #ifndef APP-IOS - // throw new Error(format(expected, this.actual)) + throw new Error(format(expected, this.actual)) // #endif // #ifdef APP-IOS NSException(name = NSExceptionName.internalInconsistencyException, reason = format(expected, this.actual)).raise()