Skip to content

Commit

Permalink
test: fix strictEqual order for timers test
Browse files Browse the repository at this point in the history
PR-URL: #23568
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
Saleh Abdel Motaal authored and jasnell committed Oct 17, 2018
1 parent 986b6cb commit d49937a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/parallel/test-timers-linked-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,55 +41,55 @@ L.init(C);
L.init(D);

assert.ok(L.isEmpty(list));
assert.strictEqual(null, L.peek(list));
assert.strictEqual(L.peek(list), null);

L.append(list, A);
// list -> A
assert.strictEqual(A, L.peek(list));
assert.strictEqual(L.peek(list), A);

L.append(list, B);
// list -> A -> B
assert.strictEqual(A, L.peek(list));
assert.strictEqual(L.peek(list), A);

L.append(list, C);
// list -> A -> B -> C
assert.strictEqual(A, L.peek(list));
assert.strictEqual(L.peek(list), A);

L.append(list, D);
// list -> A -> B -> C -> D
assert.strictEqual(A, L.peek(list));
assert.strictEqual(L.peek(list), A);

L.remove(A);
L.remove(B);
// B is already removed, so removing it again shouldn't hurt.
L.remove(B);
// list -> C -> D
assert.strictEqual(C, L.peek(list));
assert.strictEqual(L.peek(list), C);

// Put B back on the list
L.append(list, B);
// list -> C -> D -> B
assert.strictEqual(C, L.peek(list));
assert.strictEqual(L.peek(list), C);

L.remove(C);
// list -> D -> B
assert.strictEqual(D, L.peek(list));
assert.strictEqual(L.peek(list), D);

L.remove(B);
// list -> D
assert.strictEqual(D, L.peek(list));
assert.strictEqual(L.peek(list), D);

L.remove(D);
// list
assert.strictEqual(null, L.peek(list));
assert.strictEqual(L.peek(list), null);


assert.ok(L.isEmpty(list));


L.append(list, D);
// list -> D
assert.strictEqual(D, L.peek(list));
assert.strictEqual(L.peek(list), D);

L.append(list, C);
L.append(list, B);
Expand All @@ -100,8 +100,8 @@ L.append(list, A);
L.append(list, C);
// list -> D -> B -> A -> C

assert.strictEqual(D, L.peek(list));
assert.strictEqual(B, L.peek(D));
assert.strictEqual(A, L.peek(B));
assert.strictEqual(C, L.peek(A));
assert.strictEqual(list, L.peek(C));
assert.strictEqual(L.peek(list), D);
assert.strictEqual(L.peek(D), B);
assert.strictEqual(L.peek(B), A);
assert.strictEqual(L.peek(A), C);
assert.strictEqual(L.peek(C), list);

0 comments on commit d49937a

Please sign in to comment.