Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
51b3bdb3
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看板
提交
51b3bdb3
编写于
8月 12, 2024
作者:
M
mahaifeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[arraybuffer]添加示例
上级
b10dfd35
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
118 addition
and
6 deletion
+118
-6
uni_modules/uts-tests/utssdk/TFloat32Array.uts
uni_modules/uts-tests/utssdk/TFloat32Array.uts
+10
-0
uni_modules/uts-tests/utssdk/TFloat64Array.uts
uni_modules/uts-tests/utssdk/TFloat64Array.uts
+14
-0
uni_modules/uts-tests/utssdk/TInt16Array.uts
uni_modules/uts-tests/utssdk/TInt16Array.uts
+14
-1
uni_modules/uts-tests/utssdk/TInt32Array.uts
uni_modules/uts-tests/utssdk/TInt32Array.uts
+14
-1
uni_modules/uts-tests/utssdk/TInt8Array.uts
uni_modules/uts-tests/utssdk/TInt8Array.uts
+14
-1
uni_modules/uts-tests/utssdk/TUInt8Array.uts
uni_modules/uts-tests/utssdk/TUInt8Array.uts
+10
-2
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
+14
-1
uni_modules/uts-tests/utssdk/TUint16Array.uts
uni_modules/uts-tests/utssdk/TUint16Array.uts
+14
-0
uni_modules/uts-tests/utssdk/TUint32Array.uts
uni_modules/uts-tests/utssdk/TUint32Array.uts
+14
-0
未找到文件。
uni_modules/uts-tests/utssdk/TFloat32Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -36,9 +36,19 @@ export class TFloat32Array {
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Float32Array.from
var float32Array = Float32Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(float32Array.toString()); // '2,4,6'
// #END
expect(float32Array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Float32Array.of
var float32Array = Float32Array.of(1, 2, 3)
console.log(float32Array.toString()); // '1,2,3'
// #END
expect(float32Array.toString()).toEqual("1,2,3");
}
testfloat32() {
let float32 = new Float32Array(2);
...
...
uni_modules/uts-tests/utssdk/TFloat64Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -35,6 +35,20 @@ export class TFloat64Array {
// #endif
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Float64Array.from
var float64Array = Float64Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(float64Array.toString()); // '2,4,6'
// #END
expect(float64Array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Float64Array.of
var float64Array = Float64Array.of(1, 2, 3)
console.log(float64Array.toString()); // '1,2,3'
// #END
expect(float64Array.toString()).toEqual("1,2,3");
}
testfloat64() {
let float64 = new Float64Array(2);
float64[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TInt16Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -35,7 +35,20 @@ export class TInt16Array {
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Int16Array.from
var array = Int16Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(array.toString()); // '2,4,6'
// #END
expect(array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Int16Array.of
var array = Int16Array.of(1, 2, 3)
console.log(array.toString()); // '1,2,3'
// #END
expect(array.toString()).toEqual("1,2,3");
}
testConstructor() {
let buffer = new ArrayBuffer(16);
let int16 = new Int16Array(buffer);
...
...
uni_modules/uts-tests/utssdk/TInt32Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -37,7 +37,20 @@ export class TInt32Array {
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Int32Array.from
var array = Int32Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(array.toString()); // '2,4,6'
// #END
expect(array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Int32Array.of
var array = Int32Array.of(1, 2, 3)
console.log(array.toString()); // '1,2,3'
// #END
expect(array.toString()).toEqual("1,2,3");
}
testInt32Array() {
let int32 = new Int32Array(2);
int32[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TInt8Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -37,7 +37,20 @@ export class TInt8Array {
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Int8Array.from
var array = Int8Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(array.toString()); // '2,4,6'
// #END
expect(array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Int8Array.of
var array = Int8Array.of(1, 2, 3)
console.log(array.toString()); // '1,2,3'
// #END
expect(array.toString()).toEqual("1,2,3");
}
testConstructor() {
let buffer = new ArrayBuffer(16);
let int8View = new Int8Array(buffer);
...
...
uni_modules/uts-tests/utssdk/TUInt8Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -36,12 +36,20 @@ export class TUint8Array {
// #endif
}
// #ifdef APP-ANDROID || WEB
of() {
// #TEST Uint8Array.of
var array = Uint8Array.of(1, 2, 3)
console.log(array.toString()); // '1,2,3'
// #END
expect(array.toString()).toEqual("1,2,3");
}
from() {
// #TEST Uint8Array.from
var s = new Set([1, 2, 3]);
var unit8 = Uint8Array.from(s);
console.log(unit8.toString()); // '1,2,3'
// #END
expect(unit8.toString()).toEqual('1,2,3');
console.log(unit8.toString())
}
testMAX() {
let uint8 = new Uint8Array(16);
...
...
uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts
浏览文件 @
51b3bdb3
...
...
@@ -37,7 +37,20 @@ export class TUint8ClampedArray {
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Uint8ClampedArray.from
var array = Uint8ClampedArray.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(array.toString()); // '2,4,6'
// #END
expect(array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Uint8ClampedArray.of
var array = Uint8ClampedArray.of(1, 2, 3)
console.log(array.toString()); // '1,2,3'
// #END
expect(array.toString()).toEqual("1,2,3");
}
testMAX() {
let uint8Clamped = new Uint8ClampedArray(16);
uint8Clamped[0] = 255;
...
...
uni_modules/uts-tests/utssdk/TUint16Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -36,6 +36,20 @@ export class TUint16Array {
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Uint16Array.from
var array = Uint16Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(array.toString()); // '2,4,6'
// #END
expect(array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Uint16Array.of
var array = Uint16Array.of(1, 2, 3)
console.log(array.toString()); // '1,2,3'
// #END
expect(array.toString()).toEqual("1,2,3");
}
testuint16() {
let uint16 = new Uint16Array(2);
uint16[0] = 42;
...
...
uni_modules/uts-tests/utssdk/TUint32Array.uts
浏览文件 @
51b3bdb3
...
...
@@ -37,6 +37,20 @@ export class TUint32Array {
}
// #ifdef APP-ANDROID || WEB
from() {
// #TEST Uint32Array.from
var array = Uint32Array.from([1, 2, 3], (v : number, _ : number) : number => v + v);
console.log(array.toString()); // '2,4,6'
// #END
expect(array.toString()).toEqual('2,4,6');
}
of() {
// #TEST Uint32Array.of
var array = Uint32Array.of(1, 2, 3)
console.log(array.toString()); // '1,2,3'
// #END
expect(array.toString()).toEqual("1,2,3");
}
testuint32() {
let uint32 = new Uint32Array(2);
uint32[0] = 42;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录