22
33import * as assert from 'power-assert'
44
5- import { b64decode , b64encode , b64byteLength } from '../src'
5+ import { b64byteLength , b64decode , b64encode } from '../src'
66import { fromUint8Array } from '../src/lib/from_buffer'
77import { toUint8Array } from '../src/lib/to_buffer'
88
9- import { input1 , input2 } from './config'
9+ import { input1 , input2 , isEdge , isIE } from './config'
1010import { equal } from './helper'
1111
1212
@@ -15,7 +15,8 @@ const filename = '20_big.test.ts'
1515describe ( filename , ( ) => {
1616 describe ( 'Should fromUint8Array() works with big input' , ( ) => {
1717 it ( 'test1' , ( ) => {
18- const big = new Uint8Array ( 128 * 1024 * 1024 )
18+ const count = isIE || isEdge ? 64 * 1024 * 1024 : 128 * 1024 * 1024
19+ const big = new Uint8Array ( count )
1920
2021 for ( let i = 0 , length = big . length ; i < length ; ++ i ) {
2122 big [ i ] = i % 256
@@ -27,7 +28,8 @@ describe(filename, () => {
2728 } )
2829
2930 it ( 'test2' , ( ) => {
30- const str = input1 . concat ( input2 ) . join ( '' ) . repeat ( 300_000 )
31+ const count = isIE || isEdge ? 100_000 : 300_000
32+ const str = input1 . concat ( input2 ) . join ( '' ) . repeat ( count )
3133 const len = ( str . length / 1024 / 1024 ) . toFixed ( 2 )
3234 const ret1 = b64encode ( str )
3335 const ret2 = b64decode ( ret1 )
0 commit comments