Skip to content

Commit 085de6f

Browse files
DeltaEvotargos
authored andcommitted
test: swap arguments in strictEqual()
Swap arguments in strictEqual() for parallel/test-buffer-copy. PR-URL: #23204 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e3550f2 commit 085de6f

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

test/parallel/test-buffer-copy.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ let cntr = 0;
1212
b.fill(++cntr);
1313
c.fill(++cntr);
1414
const copied = b.copy(c, 0, 0, 512);
15-
assert.strictEqual(512, copied);
15+
assert.strictEqual(copied, 512);
1616
for (let i = 0; i < c.length; i++) {
17-
assert.strictEqual(b[i], c[i]);
17+
assert.strictEqual(c[i], b[i]);
1818
}
1919
}
2020

@@ -23,9 +23,9 @@ let cntr = 0;
2323
b.fill(++cntr);
2424
c.fill(++cntr);
2525
const copied = c.copy(b, 0, 0);
26-
assert.strictEqual(c.length, copied);
26+
assert.strictEqual(copied, c.length);
2727
for (let i = 0; i < c.length; i++) {
28-
assert.strictEqual(c[i], b[i]);
28+
assert.strictEqual(b[i], c[i]);
2929
}
3030
}
3131

@@ -34,9 +34,9 @@ let cntr = 0;
3434
b.fill(++cntr);
3535
c.fill(++cntr);
3636
const copied = c.copy(b, 0);
37-
assert.strictEqual(c.length, copied);
37+
assert.strictEqual(copied, c.length);
3838
for (let i = 0; i < c.length; i++) {
39-
assert.strictEqual(c[i], b[i]);
39+
assert.strictEqual(b[i], c[i]);
4040
}
4141
}
4242

@@ -45,9 +45,9 @@ let cntr = 0;
4545
b.fill(++cntr);
4646
c.fill(++cntr);
4747
const copied = b.copy(c);
48-
assert.strictEqual(c.length, copied);
48+
assert.strictEqual(copied, c.length);
4949
for (let i = 0; i < c.length; i++) {
50-
assert.strictEqual(b[i], c[i]);
50+
assert.strictEqual(c[i], b[i]);
5151
}
5252
}
5353

@@ -56,9 +56,9 @@ let cntr = 0;
5656
b.fill(++cntr);
5757
c.fill(++cntr);
5858
const copied = b.copy(c, 0, b.length - Math.floor(c.length / 2));
59-
assert.strictEqual(Math.floor(c.length / 2), copied);
59+
assert.strictEqual(copied, Math.floor(c.length / 2));
6060
for (let i = 0; i < Math.floor(c.length / 2); i++) {
61-
assert.strictEqual(b[b.length - Math.floor(c.length / 2) + i], c[i]);
61+
assert.strictEqual(c[i], b[b.length - Math.floor(c.length / 2) + i]);
6262
}
6363
for (let i = Math.floor(c.length / 2) + 1; i < c.length; i++) {
6464
assert.strictEqual(c[c.length - 1], c[i]);
@@ -70,9 +70,9 @@ let cntr = 0;
7070
b.fill(++cntr);
7171
c.fill(++cntr);
7272
const copied = b.copy(c, 0, 0, 513);
73-
assert.strictEqual(c.length, copied);
73+
assert.strictEqual(copied, c.length);
7474
for (let i = 0; i < c.length; i++) {
75-
assert.strictEqual(b[i], c[i]);
75+
assert.strictEqual(c[i], b[i]);
7676
}
7777
}
7878

@@ -81,9 +81,9 @@ let cntr = 0;
8181
b.fill(++cntr);
8282
b.fill(++cntr, 256);
8383
const copied = b.copy(b, 0, 256, 1024);
84-
assert.strictEqual(768, copied);
84+
assert.strictEqual(copied, 768);
8585
for (let i = 0; i < b.length; i++) {
86-
assert.strictEqual(cntr, b[i]);
86+
assert.strictEqual(b[i], cntr);
8787
}
8888
}
8989

@@ -106,7 +106,7 @@ assert.throws(function() {
106106
c.fill(++cntr);
107107
b.copy(c, 0, 0, 1025);
108108
for (let i = 0; i < c.length; i++) {
109-
assert.strictEqual(b[i], c[i]);
109+
assert.strictEqual(c[i], b[i]);
110110
}
111111
}
112112

@@ -126,9 +126,9 @@ assert.strictEqual(b.copy(c, 512, 0, 10), 0);
126126
b.fill(++cntr);
127127
d.fill(++cntr);
128128
const copied = b.copy(d, 0, 0, 512);
129-
assert.strictEqual(512, copied);
129+
assert.strictEqual(copied, 512);
130130
for (let i = 0; i < d.length; i++) {
131-
assert.strictEqual(b[i], d[i]);
131+
assert.strictEqual(d[i], b[i]);
132132
}
133133
}
134134

@@ -139,8 +139,8 @@ assert.strictEqual(b.copy(c, 512, 0, 10), 0);
139139
e.fill(++cntr);
140140
c.fill(++cntr);
141141
const copied = Buffer.prototype.copy.call(e, c, 0, 0, 512);
142-
assert.strictEqual(512, copied);
142+
assert.strictEqual(copied, 512);
143143
for (let i = 0; i < c.length; i++) {
144-
assert.strictEqual(e[i], c[i]);
144+
assert.strictEqual(c[i], e[i]);
145145
}
146146
}

0 commit comments

Comments
 (0)