blob: 638f2283bb5835602ac16e89a7ee8ca4544ee296 [file] [log] [blame]
This test checks the ES6 string functions repeat().
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS 'foo bar'.repeat(+0) is ''
PASS 'foo bar'.repeat(-0) is ''
PASS 'foo bar'.repeat(1) is 'foo bar'
PASS 'foo bar'.repeat(2) is 'foo barfoo bar'
PASS 'フーバー'.repeat(0) is ''
PASS 'フーバー'.repeat(1) is 'フーバー'
PASS 'フーバー'.repeat(2) is 'フーバーフーバー'
PASS 'foo barfoo bar'.repeat(2) is 'foo barfoo barfoo barfoo bar'
PASS 'foo barfoo bar'.repeat(2.2) is 'foo barfoo barfoo barfoo bar'
PASS 'foo barfoo bar'.repeat(2.8) is 'foo barfoo barfoo barfoo bar'
PASS 'foo'.repeat(3.1) is 'foofoofoo'
PASS 'foo'.repeat('2') is 'foofoo'
PASS 'foo'.repeat(NaN) is ''
PASS 'foo'.repeat(null) is ''
PASS 'foo'.repeat(true) is 'foo'
PASS 'foo'.repeat(false) is ''
PASS 'foo'.repeat(undefined) is ''
PASS 'foo'.repeat() is ''
PASS 'f'.repeat(0) is ''
PASS 'f'.repeat(1) is 'f'
PASS 'f'.repeat(10) is 'ffffffffff'
PASS 'フ'.repeat(0) is ''
PASS 'フ'.repeat(1) is 'フ'
PASS 'フ'.repeat(2) is 'フフ'
PASS ''.repeat(1000) is ''
PASS ''.repeat(0xFFFFFFFF) is ''
PASS ''.repeat(0xFFFFFFFF + 1) is ''
PASS 'foo bar'.repeat(-1) threw exception RangeError: repeat() argument must be greater than or equal to 0 and not be infinity.
PASS 'foo bar'.repeat(Infinity) threw exception RangeError: repeat() argument must be greater than or equal to 0 and not be infinity.
PASS 'foo bar'.repeat(-Infinity) threw exception RangeError: repeat() argument must be greater than or equal to 0 and not be infinity.
PASS 'f'.repeat(0xFFFFFFFF) threw exception Error: Out of memory.
PASS 'f'.repeat(0xFFFFFFFF + 1) threw exception Error: Out of memory.
PASS 'foo'.repeat(0xFFFFFFFFF) threw exception Error: Out of memory.
PASS 'foo'.repeat(0xFFFFFFFFF + 1) threw exception Error: Out of memory.
PASS 'foo bar'.repeat(0xFFFFFFFF) threw exception Error: Out of memory.
PASS 'foo bar'.repeat(0xFFFFFFFF + 1) threw exception Error: Out of memory.
PASS stringRepeated.repeat(count) is 'foo barfoo bar'
PASS sideEffect == 'AB' is true
PASS stringRepeated.repeat(count) threw exception error.
PASS sideEffect == '' is true
PASS stringRepeated.repeat(count) threw exception error.
PASS sideEffect == 'A' is true
PASS successfullyParsed is true
TEST COMPLETE