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

给部分测试例加条件编译,避免iOS报错

上级 eebbfbf6
......@@ -318,9 +318,11 @@ export function testOperators(): Result {
let a = 5; // 00000000000000000000000000000101
a >>>= 2; // 00000000000000000000000000000001
expect(a).toEqual(1);
// #ifdef APP-ANDROID
let b = -5; // -00000000000000000000000000000101
b >>>= 2; // 00111111111111111111111111111110
expect(b).toEqual(1073741822);
// #endif
})
})
}
......@@ -256,8 +256,8 @@ export function testRegExp(): Result {
const CHUNK_REGEXP =
/^(\S*)?\s*(\d*\.?\d+(?:ms|s)?)?\s*(\S*)?\s*(\d*\.?\d+(?:ms|s)?)?$/
const match2 = CHUNK_REGEXP.exec('none')
expect(match2?.[0]).toEqual("none");
expect(match2?.[1]).toEqual("none");
expect(match2![0]).toEqual("none");
expect(match2![1]).toEqual("none");
// expect(JSON.stringify(match2![2])).toEqual("null");
// expect(JSON.stringify(match2![3])).toEqual("null");
// expect(JSON.stringify(match2![4])).toEqual("null");
......
......@@ -140,12 +140,12 @@ export function testString(): Result {
const str = 'The quick brown fox jumps over the lazy dog. It barked.';
const result = str.match(new RegExp('[A-Z]', 'g'));
// expect(result!.length).toEqual(2);
expect(result?.[0]).toEqual("T");
expect(result?.[1]).toEqual("I");
expect(result![0]).toEqual("T");
expect(result![1]).toEqual("I");
const result2 = str.match(new RegExp('[A-Z]'));
// expect(result2!.length).toEqual(1);
expect(result2?.[0]).toEqual("T");
expect(result2![0]).toEqual("T");
// #ifdef APP-ANDROID
const gradientString = 'linear-gradient(to right, rgb(255, 0, 0), #00FF00, hsl(120, 100%, 50%))';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册