Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
1ed4b2ab
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1595
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1ed4b2ab
编写于
8月 02, 2024
作者:
M
mahaifeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[arraybuffer]1.0支持arraybuffer
上级
b8fbad5c
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
60 addition
and
60 deletion
+60
-60
uni_modules/uts-tests/utssdk/ArrayBuffer.uts
uni_modules/uts-tests/utssdk/ArrayBuffer.uts
+3
-3
uni_modules/uts-tests/utssdk/TDataView.uts
uni_modules/uts-tests/utssdk/TDataView.uts
+1
-1
uni_modules/uts-tests/utssdk/TFloat32Array.uts
uni_modules/uts-tests/utssdk/TFloat32Array.uts
+3
-3
uni_modules/uts-tests/utssdk/TFloat64Array.uts
uni_modules/uts-tests/utssdk/TFloat64Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TInt16Array.uts
uni_modules/uts-tests/utssdk/TInt16Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TInt32Array.uts
uni_modules/uts-tests/utssdk/TInt32Array.uts
+15
-15
uni_modules/uts-tests/utssdk/TInt8Array.uts
uni_modules/uts-tests/utssdk/TInt8Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TUInt8Array.uts
uni_modules/uts-tests/utssdk/TUInt8Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
+2
-2
uni_modules/uts-tests/utssdk/TUint16Array.uts
uni_modules/uts-tests/utssdk/TUint16Array.uts
+2
-2
uni_modules/uts-tests/utssdk/TUint32Array.uts
uni_modules/uts-tests/utssdk/TUint32Array.uts
+2
-2
uni_modules/uts-tests/utssdk/index.uts
uni_modules/uts-tests/utssdk/index.uts
+24
-24
未找到文件。
uni_modules/uts-tests/utssdk/ArrayBuffer.uts
浏览文件 @
1ed4b2ab
...
...
@@ -9,7 +9,7 @@ import { TUint8Array } from './TUInt8Array.uts'
import { TUint8ClampedArray } from './TUInt8ClampedArray.uts'
import { TUint16Array } from './TUint16Array.uts'
import { TUint32Array } from './TUint32Array.uts'
// #ifdef
UNI-APP-X &&
APP-ANDROID
// #ifdef APP-ANDROID
import ByteBuffer from 'java.nio.ByteBuffer';
// #endif
...
...
@@ -26,7 +26,7 @@ const int16 = new TInt16Array()
export function testArrayBuffer() : Result {
return describe("ArrayBuffer", () => {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
test('arraybuffer_isview', () => {
// #TEST ArrayBuffer.isView
var arrayBuffer = new ArrayBuffer(16)
...
...
@@ -42,7 +42,7 @@ export function testArrayBuffer() : Result {
expect(isViewA).toEqual(false);
})
// #ifdef
UNI-APP-X &&
APP-ANDROID
// #ifdef APP-ANDROID
test('arraybuffer_toByteBuffer', () => {
// #TEST ArrayBuffer.fromByteBuffer,ArrayBuffer.toByteBuffer
var byteBuffer = ByteBuffer.allocate(100)
...
...
uni_modules/uts-tests/utssdk/TDataView.uts
浏览文件 @
1ed4b2ab
...
...
@@ -18,7 +18,7 @@ export class TDataView {
// this.setUint8();
// this.testMix();
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
setConstructor() {
let buffer = new ArrayBuffer(16);
let dataview = new DataView(buffer);
...
...
uni_modules/uts-tests/utssdk/TFloat32Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TFloat32Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testfloat32();
this.testConstructor();
this.testSet();
...
...
@@ -34,7 +34,7 @@ export class TFloat32Array {
this.arrayBufferSlice();
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
from() {
var float32Array = Float32Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
expect(float32Array.toString()).toEqual('2,4,6');
...
...
@@ -399,4 +399,4 @@ export class TFloat32Array {
}
// #endif
}
}
\ No newline at end of file
uni_modules/uts-tests/utssdk/TFloat64Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TFloat64Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testfloat64();
this.testConstructor();
this.testSet();
...
...
@@ -34,7 +34,7 @@ export class TFloat64Array {
this.arrayBufferSlice();
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
testfloat64() {
let float64 = new Float64Array(2);
float64[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TInt16Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TInt16Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testConstructor();
this.testSet();
this.testCopyWith();
...
...
@@ -34,7 +34,7 @@ export class TInt16Array {
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
testConstructor() {
let buffer = new ArrayBuffer(16);
...
...
uni_modules/uts-tests/utssdk/TInt32Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TInt32Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testInt32Array();
this.testConstructor();
...
...
@@ -36,7 +36,7 @@ export class TInt32Array {
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
testInt32Array() {
let int32 = new Int32Array(2);
...
...
@@ -103,7 +103,7 @@ export class TInt32Array {
int32 = new Int32Array([1, 2, 3]).fill(4, 1);
console.log(int32.toString()); // "1,4,4"
// expect(int32.toString()).toEqual("1,4,4");
int32 = new Int32Array([1, 2, 3]).fill(4, 1, 2);
...
...
@@ -113,7 +113,7 @@ export class TInt32Array {
int32 = new Int32Array([1, 2, 3]).fill(4, 1, 1);
console.log(int32.toString()); // "1,2,3"
// expect(int32.toString()).toEqual("1,2,3");
int32 = new Int32Array([1, 2, 3]).fill(4, -3, -2);
...
...
@@ -182,7 +182,7 @@ export class TInt32Array {
res = int32.includes(4);
console.log(res); // false
// expect(res).toEqual(false);
res = int32.includes(3, 3);
...
...
@@ -196,7 +196,7 @@ export class TInt32Array {
let int32 = new Int32Array([2, 5, 9]);
let res = int32.indexOf(2);
console.log(res); // 0
// expect(res).toEqual(0);
res = int32.indexOf(7);
...
...
@@ -225,12 +225,12 @@ export class TInt32Array {
let int32 = new Int32Array([1, 2, 3]);
let res = int32.join();
console.log(res); // "1,2,3"
// expect(res).toEqual("1,2,3");
res = int32.join(" / ");
console.log(res); // "1 / 2 / 3"
// expect(res).toEqual("1 / 2 / 3");
res = int32.join("");
...
...
@@ -265,7 +265,7 @@ export class TInt32Array {
let total = new Int32Array([0, 1, 2, 3]);
let res = total.reduce((accumulator : number, currentValue : number, _ : number, _a : Int32Array) : number => accumulator + currentValue);
console.log(res); // 6
// expect(res).toEqual(6);
total = new Int32Array([0, 1, 2, 3]);
...
...
@@ -279,7 +279,7 @@ export class TInt32Array {
let total = new Int32Array([0, 1, 2, 3]);
let res = total.reduceRight((accumulator : number, currentValue : number, _ : number, _a : Int32Array) : number => accumulator + currentValue);
console.log(res); // 6
// expect(res).toEqual(6);
total = new Int32Array([0, 1, 2, 3]);
...
...
@@ -303,17 +303,17 @@ export class TInt32Array {
let int32 = new Int32Array([1, 2, 3]);
let res = int32.slice(1);
console.log(res.toString()); // "2,3"
// expect(res.toString()).toEqual("2,3");
res = int32.slice(2);
console.log(res.toString()); // "3"
// expect(res.toString()).toEqual("3");
res = int32.slice(-2);
console.log(res.toString()); // "2,3"
// expect(res.toString()).toEqual("2,3");
res = int32.slice(0, 1);
...
...
@@ -327,7 +327,7 @@ export class TInt32Array {
let numbers = new Int32Array([40, 1, 5]);
numbers.sort();
console.log(numbers.toString()); // "1,5,40"
// expect(numbers.toString()).toEqual("1,5,40");
numbers.sort((a, b) : number => a - b);
...
...
@@ -379,7 +379,7 @@ export class TInt32Array {
const positives = new Int32Array([10, 20, 30, 40, 50]);
console.log(int32.some((element : number, index : number, array : Int32Array) : boolean => element < 0)); // true
// expect(int32.some((element : number, index : number, array : Int32Array) : boolean => element < 0)).toEqual(true);
console.log(positives.some((element : number, index : number, array : Int32Array) : boolean => element < 0)); // false
...
...
uni_modules/uts-tests/utssdk/TInt8Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -8,7 +8,7 @@ import {
export class TInt8Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testConstructor();
this.testSet();
...
...
@@ -36,7 +36,7 @@ export class TInt8Array {
//#endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
testConstructor() {
let buffer = new ArrayBuffer(16);
...
...
uni_modules/uts-tests/utssdk/TUInt8Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TUint8Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testMAX();
this.testConstructor();
...
...
@@ -35,7 +35,7 @@ export class TUint8Array {
this.arrayBufferSlice();
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
from() {
var s = new Set([1, 2, 3]);
...
...
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TUint8ClampedArray {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testMAX();
this.testConstructor();
...
...
@@ -36,7 +36,7 @@ export class TUint8ClampedArray {
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
testMAX() {
let uint8Clamped = new Uint8ClampedArray(16);
...
...
uni_modules/uts-tests/utssdk/TUint16Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TUint16Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testuint16();
this.testConstructor();
this.testSet();
...
...
@@ -35,7 +35,7 @@ export class TUint16Array {
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
testuint16() {
let uint16 = new Uint16Array(2);
uint16[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TUint32Array.uts
浏览文件 @
1ed4b2ab
...
...
@@ -7,7 +7,7 @@ import {
export class TUint32Array {
test() {
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
this.testuint32();
this.testConstructor();
...
...
@@ -36,7 +36,7 @@ export class TUint32Array {
// #endif
}
// #ifdef
(UNI-APP-X && APP-ANDROID)
|| WEB
// #ifdef
APP-ANDROID
|| WEB
testuint32() {
let uint32 = new Uint32Array(2);
uint32[0] = 42;
...
...
uni_modules/uts-tests/utssdk/index.uts
浏览文件 @
1ed4b2ab
...
...
@@ -3,10 +3,10 @@ import { testDate } from './Date.uts'
import { testString } from './String.uts'
import { testError } from './Error.uts'
import { testKeyWord } from './KeyWord.uts'
import { testJSON } from './JSON.uts'
import { testJSONLarge } from './JSON_large.uts'
import { testUTSJSONObject } from './UTSJSONObject.uts'
import { testConsole } from './console.uts'
import { testJSON } from './JSON.uts'
import { testJSONLarge } from './JSON_large.uts'
import { testUTSJSONObject } from './UTSJSONObject.uts'
import { testConsole } from './console.uts'
import { testNumber } from './Number.uts'
import { testMap } from './Map.uts'
import { testSet } from './Set.uts'
...
...
@@ -16,9 +16,9 @@ import { testRegExp } from './RegExp.uts'
import { testForLoop } from './ForLoop.uts'
import { testGlobal } from './Global.uts'
import { testType } from './Type.uts'
export { Result } from './tests.uts'
import { testArrayBuffer } from './ArrayBuffer.uts'
import { testNativeCode } from './NativeCode.uts'
export { Result } from './tests.uts'
import { testArrayBuffer } from './ArrayBuffer.uts'
import { testNativeCode } from './NativeCode.uts'
// Promise、Proxy、Reflect、Weakmap、WeakSet 不支持
...
...
@@ -37,22 +37,22 @@ export function runTests() : UTSJSONObject {
const KeyWordRes = testKeyWord();
const ForLoopRes = testForLoop();
const GlobalRes = testGlobal();
const TypeRes = testType();
const TypeRes = testType();
const JSONLargeRes = testJSONLarge();
const consoleRes = testConsole();
const UTSJSONObjectRes = testUTSJSONObject();
// #ifdef
(UNI-APP-X && APP-ANDROID) || WEB
const ArrayBufferRes = testArrayBuffer();
// #endif
const consoleRes = testConsole();
const UTSJSONObjectRes = testUTSJSONObject();
// #ifdef
APP-ANDROID || WEB
const ArrayBufferRes = testArrayBuffer();
// #endif
const NativeCodeRes = testNativeCode();
return {
Array: ArrayRes,
Date: DateRes,
String: StringRes,
Error: ErrorRes,
Json: JsonRes,
JSONLarge:JSONLargeRes,
Json: JsonRes,
JSONLarge:
JSONLargeRes,
Number: NumberRes,
Map: MapRes,
Set: SetRes,
...
...
@@ -61,13 +61,13 @@ export function runTests() : UTSJSONObject {
RegExp: RegExpRes,
KeyWord: KeyWordRes,
ForLoop: ForLoopRes,
Global: GlobalRes,
Type: TypeRes,
console:
consoleRes,
UTSJSONObject:
UTSJSONObjectRes,
// #ifdef
(UNI-APP-X && APP-ANDROID) || WEB
ArrayBuffer:
ArrayBufferRes,
// #endif
NativeCode:NativeCodeRes
Global: GlobalRes,
Type: TypeRes,
console:
consoleRes,
UTSJSONObject:
UTSJSONObjectRes,
// #ifdef
APP-ANDROID || WEB
ArrayBuffer:
ArrayBufferRes,
// #endif
NativeCode:
NativeCodeRes
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录