summaryrefslogtreecommitdiff
path: root/test/parallel/test-writeint.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2016-12-30 11:46:21 -0500
committercjihrig <cjihrig@gmail.com>2017-01-02 09:52:31 -0500
commit6540fb9f1f02fe1d9a4a783cc768826d5e759aad (patch)
tree91526c0fa2e69605d0848d9c2178e8bdde1587d6 /test/parallel/test-writeint.js
parent746a46ebddf594370137042b9b3a0af80daff903 (diff)
downloadnode-new-6540fb9f1f02fe1d9a4a783cc768826d5e759aad.tar.gz
test: s/ASSERT/assert/
This commit addresses an inconsistency with eight tests. These tests use the assert module, but named the variable ASSERT. This goes against the project's typical coding style, and negatively impacts global find and replace updates. PR-URL: https://github.com/nodejs/node/pull/10544 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-writeint.js')
-rw-r--r--test/parallel/test-writeint.js154
1 files changed, 77 insertions, 77 deletions
diff --git a/test/parallel/test-writeint.js b/test/parallel/test-writeint.js
index d05a90d48b..43784fb390 100644
--- a/test/parallel/test-writeint.js
+++ b/test/parallel/test-writeint.js
@@ -3,7 +3,7 @@
* Tests to verify we're writing signed integers correctly
*/
require('../common');
-var ASSERT = require('assert');
+const assert = require('assert');
function test8(clazz) {
var buffer = new clazz(2);
@@ -11,14 +11,14 @@ function test8(clazz) {
buffer.writeInt8(0x23, 0);
buffer.writeInt8(-5, 1);
- ASSERT.equal(0x23, buffer[0]);
- ASSERT.equal(0xfb, buffer[1]);
+ assert.equal(0x23, buffer[0]);
+ assert.equal(0xfb, buffer[1]);
/* Make sure we handle truncation correctly */
- ASSERT.throws(function() {
+ assert.throws(function() {
buffer.writeInt8(0xabc, 0);
});
- ASSERT.throws(function() {
+ assert.throws(function() {
buffer.writeInt8(0xabc, 0);
});
@@ -26,12 +26,12 @@ function test8(clazz) {
buffer.writeInt8(0x7f, 0);
buffer.writeInt8(-0x80, 1);
- ASSERT.equal(0x7f, buffer[0]);
- ASSERT.equal(0x80, buffer[1]);
- ASSERT.throws(function() {
+ assert.equal(0x7f, buffer[0]);
+ assert.equal(0x80, buffer[1]);
+ assert.throws(function() {
buffer.writeInt8(0x7f + 1, 0);
});
- ASSERT.throws(function() {
+ assert.throws(function() {
buffer.writeInt8(-0x80 - 1, 0);
});
}
@@ -42,49 +42,49 @@ function test16(clazz) {
buffer.writeInt16BE(0x0023, 0);
buffer.writeInt16LE(0x0023, 2);
- ASSERT.equal(0x00, buffer[0]);
- ASSERT.equal(0x23, buffer[1]);
- ASSERT.equal(0x23, buffer[2]);
- ASSERT.equal(0x00, buffer[3]);
+ assert.equal(0x00, buffer[0]);
+ assert.equal(0x23, buffer[1]);
+ assert.equal(0x23, buffer[2]);
+ assert.equal(0x00, buffer[3]);
buffer.writeInt16BE(-5, 0);
buffer.writeInt16LE(-5, 2);
- ASSERT.equal(0xff, buffer[0]);
- ASSERT.equal(0xfb, buffer[1]);
- ASSERT.equal(0xfb, buffer[2]);
- ASSERT.equal(0xff, buffer[3]);
+ assert.equal(0xff, buffer[0]);
+ assert.equal(0xfb, buffer[1]);
+ assert.equal(0xfb, buffer[2]);
+ assert.equal(0xff, buffer[3]);
buffer.writeInt16BE(-1679, 1);
buffer.writeInt16LE(-1679, 3);
- ASSERT.equal(0xf9, buffer[1]);
- ASSERT.equal(0x71, buffer[2]);
- ASSERT.equal(0x71, buffer[3]);
- ASSERT.equal(0xf9, buffer[4]);
+ assert.equal(0xf9, buffer[1]);
+ assert.equal(0x71, buffer[2]);
+ assert.equal(0x71, buffer[3]);
+ assert.equal(0xf9, buffer[4]);
/* Make sure we handle min/max correctly */
buffer.writeInt16BE(0x7fff, 0);
buffer.writeInt16BE(-0x8000, 2);
- ASSERT.equal(0x7f, buffer[0]);
- ASSERT.equal(0xff, buffer[1]);
- ASSERT.equal(0x80, buffer[2]);
- ASSERT.equal(0x00, buffer[3]);
- ASSERT.throws(function() {
+ assert.equal(0x7f, buffer[0]);
+ assert.equal(0xff, buffer[1]);
+ assert.equal(0x80, buffer[2]);
+ assert.equal(0x00, buffer[3]);
+ assert.throws(function() {
buffer.writeInt16BE(0x7fff + 1, 0);
});
- ASSERT.throws(function() {
+ assert.throws(function() {
buffer.writeInt16BE(-0x8000 - 1, 0);
});
buffer.writeInt16LE(0x7fff, 0);
buffer.writeInt16LE(-0x8000, 2);
- ASSERT.equal(0xff, buffer[0]);
- ASSERT.equal(0x7f, buffer[1]);
- ASSERT.equal(0x00, buffer[2]);
- ASSERT.equal(0x80, buffer[3]);
- ASSERT.throws(function() {
+ assert.equal(0xff, buffer[0]);
+ assert.equal(0x7f, buffer[1]);
+ assert.equal(0x00, buffer[2]);
+ assert.equal(0x80, buffer[3]);
+ assert.throws(function() {
buffer.writeInt16LE(0x7fff + 1, 0);
});
- ASSERT.throws(function() {
+ assert.throws(function() {
buffer.writeInt16LE(-0x8000 - 1, 0);
});
}
@@ -95,69 +95,69 @@ function test32(clazz) {
buffer.writeInt32BE(0x23, 0);
buffer.writeInt32LE(0x23, 4);
- ASSERT.equal(0x00, buffer[0]);
- ASSERT.equal(0x00, buffer[1]);
- ASSERT.equal(0x00, buffer[2]);
- ASSERT.equal(0x23, buffer[3]);
- ASSERT.equal(0x23, buffer[4]);
- ASSERT.equal(0x00, buffer[5]);
- ASSERT.equal(0x00, buffer[6]);
- ASSERT.equal(0x00, buffer[7]);
+ assert.equal(0x00, buffer[0]);
+ assert.equal(0x00, buffer[1]);
+ assert.equal(0x00, buffer[2]);
+ assert.equal(0x23, buffer[3]);
+ assert.equal(0x23, buffer[4]);
+ assert.equal(0x00, buffer[5]);
+ assert.equal(0x00, buffer[6]);
+ assert.equal(0x00, buffer[7]);
buffer.writeInt32BE(-5, 0);
buffer.writeInt32LE(-5, 4);
- ASSERT.equal(0xff, buffer[0]);
- ASSERT.equal(0xff, buffer[1]);
- ASSERT.equal(0xff, buffer[2]);
- ASSERT.equal(0xfb, buffer[3]);
- ASSERT.equal(0xfb, buffer[4]);
- ASSERT.equal(0xff, buffer[5]);
- ASSERT.equal(0xff, buffer[6]);
- ASSERT.equal(0xff, buffer[7]);
+ assert.equal(0xff, buffer[0]);
+ assert.equal(0xff, buffer[1]);
+ assert.equal(0xff, buffer[2]);
+ assert.equal(0xfb, buffer[3]);
+ assert.equal(0xfb, buffer[4]);
+ assert.equal(0xff, buffer[5]);
+ assert.equal(0xff, buffer[6]);
+ assert.equal(0xff, buffer[7]);
buffer.writeInt32BE(-805306713, 0);
buffer.writeInt32LE(-805306713, 4);
- ASSERT.equal(0xcf, buffer[0]);
- ASSERT.equal(0xff, buffer[1]);
- ASSERT.equal(0xfe, buffer[2]);
- ASSERT.equal(0xa7, buffer[3]);
- ASSERT.equal(0xa7, buffer[4]);
- ASSERT.equal(0xfe, buffer[5]);
- ASSERT.equal(0xff, buffer[6]);
- ASSERT.equal(0xcf, buffer[7]);
+ assert.equal(0xcf, buffer[0]);
+ assert.equal(0xff, buffer[1]);
+ assert.equal(0xfe, buffer[2]);
+ assert.equal(0xa7, buffer[3]);
+ assert.equal(0xa7, buffer[4]);
+ assert.equal(0xfe, buffer[5]);
+ assert.equal(0xff, buffer[6]);
+ assert.equal(0xcf, buffer[7]);
/* Make sure we handle min/max correctly */
buffer.writeInt32BE(0x7fffffff, 0);
buffer.writeInt32BE(-0x80000000, 4);
- ASSERT.equal(0x7f, buffer[0]);
- ASSERT.equal(0xff, buffer[1]);
- ASSERT.equal(0xff, buffer[2]);
- ASSERT.equal(0xff, buffer[3]);
- ASSERT.equal(0x80, buffer[4]);
- ASSERT.equal(0x00, buffer[5]);
- ASSERT.equal(0x00, buffer[6]);
- ASSERT.equal(0x00, buffer[7]);
- ASSERT.throws(function() {
+ assert.equal(0x7f, buffer[0]);
+ assert.equal(0xff, buffer[1]);
+ assert.equal(0xff, buffer[2]);
+ assert.equal(0xff, buffer[3]);
+ assert.equal(0x80, buffer[4]);
+ assert.equal(0x00, buffer[5]);
+ assert.equal(0x00, buffer[6]);
+ assert.equal(0x00, buffer[7]);
+ assert.throws(function() {
buffer.writeInt32BE(0x7fffffff + 1, 0);
});
- ASSERT.throws(function() {
+ assert.throws(function() {
buffer.writeInt32BE(-0x80000000 - 1, 0);
});
buffer.writeInt32LE(0x7fffffff, 0);
buffer.writeInt32LE(-0x80000000, 4);
- ASSERT.equal(0xff, buffer[0]);
- ASSERT.equal(0xff, buffer[1]);
- ASSERT.equal(0xff, buffer[2]);
- ASSERT.equal(0x7f, buffer[3]);
- ASSERT.equal(0x00, buffer[4]);
- ASSERT.equal(0x00, buffer[5]);
- ASSERT.equal(0x00, buffer[6]);
- ASSERT.equal(0x80, buffer[7]);
- ASSERT.throws(function() {
+ assert.equal(0xff, buffer[0]);
+ assert.equal(0xff, buffer[1]);
+ assert.equal(0xff, buffer[2]);
+ assert.equal(0x7f, buffer[3]);
+ assert.equal(0x00, buffer[4]);
+ assert.equal(0x00, buffer[5]);
+ assert.equal(0x00, buffer[6]);
+ assert.equal(0x80, buffer[7]);
+ assert.throws(function() {
buffer.writeInt32LE(0x7fffffff + 1, 0);
});
- ASSERT.throws(function() {
+ assert.throws(function() {
buffer.writeInt32LE(-0x80000000 - 1, 0);
});
}