提交 8c301ac0 编写于 作者: lizhongyi_'s avatar lizhongyi_

iOS 增加参数传递测试用例

上级 fafc1265
......@@ -14,8 +14,8 @@
returnArray,
returnParam,
callbackArray,
callbackParam
} from '../../uni_modules/uts-advance'
callbackParam,
} from '@/uni_modules/uts-advance'
......@@ -24,7 +24,7 @@
return {}
},
methods: {
inputArrayTest() {
let ret = inputArray(['a', 'b', 'c'])
if (ret) {
......@@ -37,7 +37,7 @@
inputParamTest() {
let ret = inputParam({
title: "hello",
array: [1, 2, 3]
array: ["1", "2", "3"]
})
if (ret) {
uni.showToast({
......
......@@ -101,4 +101,65 @@ export function removeExampleImageView() {
AdvanceModuleGloabInfo.imageView = null
}
})
}
\ No newline at end of file
}
/**
* add since 2023-06-19
* 新增传参测试用例
*/
export function inputArray(input : Array<string>) : boolean {
let inputStr = JSON.stringify(input)
if ('["a","b","c"]' == inputStr) {
return true
}
return false
}
export type ParamOptions = {
title : string,
array : Array<string>
}
export function inputParam(option : ParamOptions) : boolean {
console.log(option, "传入的参数")
let inputStr = JSON.stringify(option)
console.log(inputStr, 'stringify option')
if ('{"array":[1,2,3],"title":"hello"}' == inputStr) {
return true
}
return false
}
export function returnArray() : Array<string> {
return ['1', '2', '3']
}
export function returnParam() : ParamOptions {
let ret : ParamOptions = {
title: "returnParam",
array: ['1', '2', '3']
}
return ret
}
export type ParamCallback = (res : ParamOptions) => void
export type ArrayCallback = (res : Array<string>) => void
export function callbackArray(callback : ArrayCallback) {
callback(['8', '8', '8'])
}
export function callbackParam(callback : ParamCallback) {
let ret : ParamOptions = {
title: "callbackParam",
array: ['4', '5', '6']
}
callback(ret)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册