test BigInt toString with default radix

Thanks to Jeff Walden for suggesting this test case.
This commit is contained in:
Robin Templeton 2018-04-17 20:25:35 -04:00
parent 08cc5a8f68
commit 6d4b9a55f1
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-bigint.prototype.tostring
description: toString with default radix
features: [BigInt]
---*/
assert.sameValue((-100n).toString(), "-100", "(-100n).toString() === '-100'");
assert.sameValue((0n).toString(), "0", "(0n).toString() === '0'");
assert.sameValue((100n).toString(), "100", "(100n).toString() === '100'");
assert.sameValue((-100n).toString(undefined), "-100",
"(-100n).toString(undefined) === '-100'");
assert.sameValue((0n).toString(undefined), "0",
"(0n).toString(undefined) === '0'");
assert.sameValue((100n).toString(undefined), "100",
"(100n).toString(undefined) === '100'");