Пример #1
0
 it('image, ' + largeData.length + ' bytes x 10,000', () => {
     for (let i = 0; i < 10000; i++) {
         const match = (largeData + 'https://example.com/img.jpeg').match(linksRe.image())
         assert(match, 'no match')
         assert(match[0] === 'https://example.com/img.jpeg', 'no match')
     }
 })
Пример #2
0
 it('by image', () => {
     match(linksRe.image(), 'https://example.com/a.jpeg')
     match(linksRe.image(), 'https://example.com/a/b.jpeg')
     match(linksRe.image(), '![](https://example.com/img2/nehoshtanit.jpg)', 'https://example.com/img2/nehoshtanit.jpg')
     match(linksRe.image(), '<img src="https://example.com/img2/nehoshtanit.jpg"', 'https://example.com/img2/nehoshtanit.jpg')
     match(linksRe.image(), 'http://example.com\nhttps://example.com/a.jpeg', 'https://example.com/a.jpeg')
     match(linksRe.image(), 'http://i.imgur.com/MWufFQi.jpg\")', 'http://i.imgur.com/MWufFQi.jpg')
     matchNot(linksRe.image(), ['http://imgur.com/iznWRVq', 'https://openmerchantaccount.com/'])
 })
Пример #3
0
 it('image (large), ' + largeData.length + ' bytes x 10,000', () => {
     for (let i = 0; i < 10000; i++) {
         matchNot(linksRe.image(), 'https://lh3.googleusercontent.com/OehcduRZPcVIX_2tlOKgYHADtBvorTfL4JtjfGAPWZyiiI9p_g2ZKEUKfuv3By-aiVfirXaYvEsViJEbxts6IeVYqidnpgkkkXAe0Q79_ARXX6CU5hBK2sZaHKa20U3jBzYbMxT-OVNX8-JYf-GYa2geUQa6pVpUDY35iaiiNBObF-TMIUOqm0P61gCdukTFwLgld2BBlxoVNNt_w6VglYHJP0W4izVNkEu7ugrU-qf2Iw9hb22SGIFNpbzL_ldomDMthIuYfKSYGsqe2ClvNKRz-_vVCQr7ggRXra16uQOdUUv5IVnkK67p9yR8ioajJ4tiGdzazYVow46pbeZ76i9_NoEYnOEX2_a7niofnC5BgAjoQEeoes1cMWVM7V8ZSexBA-cxmi0EVLds4RBkInvaUZjVL7h3oJ5I19GugPTzlyVyYtkf1ej6LNttkagqHgMck87UQGvCbwDX9ECTngffwQPYZlZKnthW0DlkFGgHN8T9uqEpl-3ki50gTa6gC0Q16mEeDRKZe7_g5Sw52OjMsfWxmBBWWMSHzlQKKAIKMKKaD6Td0O_zpiXXp7Fyl7z_iESvCpOAUAIKnyJyF_Y0UYktEmw=w2066-h1377-no')
     }
 })