| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //-------------------------------------------------------------------------------------------------------
- // Copyright (C) Microsoft. All rights reserved.
- // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
- //-------------------------------------------------------------------------------------------------------
- if (this.WScript && this.WScript.LoadScriptFile) { // Check for running in ch
- this.WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
- }
- var tests = [
- {
- name: "Assign BigInt literal",
- body: function () {
- var x = 123n;
- var y = x;
- assert.isTrue(x == 123n);
- assert.isTrue(y == 123n);
- x++;
- assert.isTrue(x == 124n);
- assert.isTrue(y == 123n);
- y = x;
- ++x;
- assert.isTrue(x == 125n);
- assert.isTrue(y == 124n);
- }
- },
- {
- name: "Assign BigInt object",
- body: function () {
- var x = BigInt(123n);
- var y = x;
- assert.isTrue(x == 123n);
- assert.isTrue(y == 123n);
- x++;
- assert.isTrue(x == 124n);
- assert.isTrue(y == 123n);
- y = x;
- ++x;
- assert.isTrue(x == 125n);
- assert.isTrue(y == 124n);
- }
- },
- ];
- testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });
|