From c4960d3c11ce1bdf85ded5acbc0c48dd10d28e6d Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sat, 5 Jan 2019 11:26:37 +0100 Subject: [PATCH] Adjust the unit test to spot a missed bug in the delete() implementation. --- src/testRunner/unittests/shimMap.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/testRunner/unittests/shimMap.ts b/src/testRunner/unittests/shimMap.ts index e169f1963cb..a47a1d18205 100644 --- a/src/testRunner/unittests/shimMap.ts +++ b/src/testRunner/unittests/shimMap.ts @@ -50,10 +50,13 @@ namespace ts { map.set("Z", "Z"); } else if (key === "Z") { - // Check that the map behaves correctly when an item is + // Check that the map behaves correctly when two items are // added and removed immediately. map.set("X", "X"); - map.delete("X"); + map.set("X1", "X1"); + map.set("X2", "X2"); + map.delete("X1"); + map.delete("X2"); map.set("Y", "Y"); } }; @@ -78,7 +81,7 @@ namespace ts { } it("iterates values in insertion order and handles changes", () => { - const expectedResult = "1:1;3:3;2:Y2;4:X4;0:X0;3:Y3;999:999;A:A;Z:Z;Y:Y;"; + const expectedResult = "1:1;3:3;2:Y2;4:X4;0:X0;3:Y3;999:999;A:A;Z:Z;X:X;Y:Y;"; // First, ensure the test actually has the same behavior as a native Map. let nativeMap = createMap();