blob: db8e1294cdc614e56a90d48cd11713b18fc42d8a [file] [log] [blame]
This test checks String.prototype.repeat.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS String.prototype.repeat.length is 1
PASS String.prototype.repeat.name is "repeat"
PASS Object.getOwnPropertyDescriptor(String.prototype, "repeat").configurable is true
PASS Object.getOwnPropertyDescriptor(String.prototype, "repeat").enumerable is false
PASS Object.getOwnPropertyDescriptor(String.prototype, "repeat").writable is true
PASS Object.getOwnPropertyDescriptor(String.prototype, "repeat").get is undefined
PASS Object.getOwnPropertyDescriptor(String.prototype, "repeat").set is undefined
PASS Object.getOwnPropertyDescriptor(String.prototype, "repeat").value is String.prototype.repeat
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 'x'.repeat(-1) threw exception RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity.
PASS 'x'.repeat(Infinity) threw exception RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity.
PASS 'x'.repeat(-Infinity) threw exception RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity.
PASS 'foo bar'.repeat(-1) threw exception RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity.
PASS 'foo bar'.repeat(Infinity) threw exception RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity.
PASS 'foo bar'.repeat(-Infinity) threw exception RangeError: String.prototype.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 'xx'
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 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