提交 6a6d410f 编写于 作者: 杜庆泉's avatar 杜庆泉

修改部分编译告警代码

上级 3de775b0
...@@ -36,14 +36,14 @@ export function testDate() : Result { ...@@ -36,14 +36,14 @@ export function testDate() : Result {
const date1 = new Date('01 Jan 1970 00:00:00 GMT'); const date1 = new Date('01 Jan 1970 00:00:00 GMT');
const date2 = new Date('December 17, 1995 03:24:00'); const date2 = new Date('December 17, 1995 03:24:00');
// // #ifndef APP-IOS // #ifndef APP-IOS
// expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800 (中国标准时间)"); expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800 (中国标准时间)");
// expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800 (中国标准时间)"); expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800 (中国标准时间)");
// // #endif // #endif
// // #ifndef APP-ANDROID // #ifndef APP-ANDROID
// expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800"); expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800");
// expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800"); expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800");
// // #endif // #endif
}) })
test('toXString', () => { test('toXString', () => {
......
...@@ -123,26 +123,27 @@ export function testString(): Result { ...@@ -123,26 +123,27 @@ export function testString(): Result {
// expect(result2!.length).toEqual(1); // 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%))'; const gradientString = 'linear-gradient(to right, rgb(255, 0, 0), #00FF00, hsl(120, 100%, 50%))';
const pattern = /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)|#([a-fA-F0-9]{2}){3}|hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)/g; const pattern = /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)|#([a-fA-F0-9]{2}){3}|hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)/g;
const result3 = gradientString.match(pattern); const result3 = gradientString.match(pattern);
// expect(result3!.length).toEqual(3); expect(result3!.length).toEqual(3);
// expect(result3![0]).toEqual("rgb(255, 0, 0)"); expect(result3![0]).toEqual("rgb(255, 0, 0)");
// expect(result3![2]).toEqual("hsl(120, 100%, 50%)"); expect(result3![2]).toEqual("hsl(120, 100%, 50%)");
const pattern2 = /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)|#([a-fA-F0-9]{2}){3}|hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)/; const pattern2 = /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)|#([a-fA-F0-9]{2}){3}|hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)/;
const result4 = gradientString.match(pattern2); const result4 = gradientString.match(pattern2);
// expect(result4!.length).toEqual(8); expect(result4!.length).toEqual(8);
// expect(result4![0]).toEqual("rgb(255, 0, 0)"); expect(result4![0]).toEqual("rgb(255, 0, 0)");
// expect(result4![1]).toEqual("255"); expect(result4![1]).toEqual("255");
// expect(result4![2]).toEqual("0"); expect(result4![2]).toEqual("0");
const url = ''; const url = '';
const urlRegex = /^(\w+):\/\/([^\/?#]+)([^?#]*)(\?[^#]*)?(#.*)?$/; const urlRegex = /^(\w+):\/\/([^\/?#]+)([^?#]*)(\?[^#]*)?(#.*)?$/;
const match = url.match(urlRegex); const match = url.match(urlRegex);
// expect(JSON.stringify(match)).toEqual("null"); expect(JSON.stringify(match)).toEqual("null");
// #endif
}) })
test('padEnd', () => { test('padEnd', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册