diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/String/prototype/padEnd/max-length-not-greater-than-string.js')
-rw-r--r-- | js/src/tests/test262/built-ins/String/prototype/padEnd/max-length-not-greater-than-string.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/String/prototype/padEnd/max-length-not-greater-than-string.js b/js/src/tests/test262/built-ins/String/prototype/padEnd/max-length-not-greater-than-string.js new file mode 100644 index 0000000000..79a4f59169 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/padEnd/max-length-not-greater-than-string.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 Jordan Harband. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.padend +description: > + String#padEnd should return the string unchanged when an integer max + length is not greater than the string length +author: Jordan Harband +---*/ + +assert.sameValue('abc'.padEnd(undefined, 'def'), 'abc'); +assert.sameValue('abc'.padEnd(null, 'def'), 'abc'); +assert.sameValue('abc'.padEnd(NaN, 'def'), 'abc'); +assert.sameValue('abc'.padEnd(-Infinity, 'def'), 'abc'); +assert.sameValue('abc'.padEnd(0, 'def'), 'abc'); +assert.sameValue('abc'.padEnd(-1, 'def'), 'abc'); +assert.sameValue('abc'.padEnd(3, 'def'), 'abc'); +assert.sameValue('abc'.padEnd(3.9999, 'def'), 'abc'); + +reportCompare(0, 0); |