summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDuarte David <deltaduartedavid@gmail.com>2018-10-01 20:10:30 +0200
committerMichaël Zasso <targos@protonmail.com>2018-10-06 14:39:37 +0200
commit635161ae98ae0a88a354f749fecc3b62da3203b9 (patch)
tree884c80a21ae0766c54533757525dd32a274ef2fb /test
parent247ea557fcd51c69b0be1d2baa4c49db7b4e0e98 (diff)
downloadandroid-node-v8-635161ae98ae0a88a354f749fecc3b62da3203b9.tar.gz
android-node-v8-635161ae98ae0a88a354f749fecc3b62da3203b9.tar.bz2
android-node-v8-635161ae98ae0a88a354f749fecc3b62da3203b9.zip
test: swap arguments in strictEqual()
Swap arguments in strictEqual() for parallel/test-buffer-copy. PR-URL: https://github.com/nodejs/node/pull/23204 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-buffer-copy.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/parallel/test-buffer-copy.js b/test/parallel/test-buffer-copy.js
index 5c82f4de28..8ede510146 100644
--- a/test/parallel/test-buffer-copy.js
+++ b/test/parallel/test-buffer-copy.js
@@ -12,9 +12,9 @@ let cntr = 0;
b.fill(++cntr);
c.fill(++cntr);
const copied = b.copy(c, 0, 0, 512);
- assert.strictEqual(512, copied);
+ assert.strictEqual(copied, 512);
for (let i = 0; i < c.length; i++) {
- assert.strictEqual(b[i], c[i]);
+ assert.strictEqual(c[i], b[i]);
}
}
@@ -23,9 +23,9 @@ let cntr = 0;
b.fill(++cntr);
c.fill(++cntr);
const copied = c.copy(b, 0, 0);
- assert.strictEqual(c.length, copied);
+ assert.strictEqual(copied, c.length);
for (let i = 0; i < c.length; i++) {
- assert.strictEqual(c[i], b[i]);
+ assert.strictEqual(b[i], c[i]);
}
}
@@ -34,9 +34,9 @@ let cntr = 0;
b.fill(++cntr);
c.fill(++cntr);
const copied = c.copy(b, 0);
- assert.strictEqual(c.length, copied);
+ assert.strictEqual(copied, c.length);
for (let i = 0; i < c.length; i++) {
- assert.strictEqual(c[i], b[i]);
+ assert.strictEqual(b[i], c[i]);
}
}
@@ -45,9 +45,9 @@ let cntr = 0;
b.fill(++cntr);
c.fill(++cntr);
const copied = b.copy(c);
- assert.strictEqual(c.length, copied);
+ assert.strictEqual(copied, c.length);
for (let i = 0; i < c.length; i++) {
- assert.strictEqual(b[i], c[i]);
+ assert.strictEqual(c[i], b[i]);
}
}
@@ -56,9 +56,9 @@ let cntr = 0;
b.fill(++cntr);
c.fill(++cntr);
const copied = b.copy(c, 0, b.length - Math.floor(c.length / 2));
- assert.strictEqual(Math.floor(c.length / 2), copied);
+ assert.strictEqual(copied, Math.floor(c.length / 2));
for (let i = 0; i < Math.floor(c.length / 2); i++) {
- assert.strictEqual(b[b.length - Math.floor(c.length / 2) + i], c[i]);
+ assert.strictEqual(c[i], b[b.length - Math.floor(c.length / 2) + i]);
}
for (let i = Math.floor(c.length / 2) + 1; i < c.length; i++) {
assert.strictEqual(c[c.length - 1], c[i]);
@@ -70,9 +70,9 @@ let cntr = 0;
b.fill(++cntr);
c.fill(++cntr);
const copied = b.copy(c, 0, 0, 513);
- assert.strictEqual(c.length, copied);
+ assert.strictEqual(copied, c.length);
for (let i = 0; i < c.length; i++) {
- assert.strictEqual(b[i], c[i]);
+ assert.strictEqual(c[i], b[i]);
}
}
@@ -81,9 +81,9 @@ let cntr = 0;
b.fill(++cntr);
b.fill(++cntr, 256);
const copied = b.copy(b, 0, 256, 1024);
- assert.strictEqual(768, copied);
+ assert.strictEqual(copied, 768);
for (let i = 0; i < b.length; i++) {
- assert.strictEqual(cntr, b[i]);
+ assert.strictEqual(b[i], cntr);
}
}
@@ -106,7 +106,7 @@ assert.throws(function() {
c.fill(++cntr);
b.copy(c, 0, 0, 1025);
for (let i = 0; i < c.length; i++) {
- assert.strictEqual(b[i], c[i]);
+ assert.strictEqual(c[i], b[i]);
}
}
@@ -126,9 +126,9 @@ assert.strictEqual(b.copy(c, 512, 0, 10), 0);
b.fill(++cntr);
d.fill(++cntr);
const copied = b.copy(d, 0, 0, 512);
- assert.strictEqual(512, copied);
+ assert.strictEqual(copied, 512);
for (let i = 0; i < d.length; i++) {
- assert.strictEqual(b[i], d[i]);
+ assert.strictEqual(d[i], b[i]);
}
}
@@ -139,8 +139,8 @@ assert.strictEqual(b.copy(c, 512, 0, 10), 0);
e.fill(++cntr);
c.fill(++cntr);
const copied = Buffer.prototype.copy.call(e, c, 0, 0, 512);
- assert.strictEqual(512, copied);
+ assert.strictEqual(copied, 512);
for (let i = 0; i < c.length; i++) {
- assert.strictEqual(e[i], c[i]);
+ assert.strictEqual(c[i], e[i]);
}
}