From f6fcb26a9d5801396743d5ba0dd44d48e1c5ac21 Mon Sep 17 00:00:00 2001 From: Ty Mick Date: Thu, 15 Oct 2020 11:14:05 -0500 Subject: [PATCH] fix(learn): strengthen a test in "Data Structures: Remove Elements from a Linked List" (#39977) * Add an additional test to LinkedList.remove * Consolidate tests --- .../data-structures/remove-elements-from-a-linked-list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/10-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.md b/curriculum/challenges/english/10-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.md index f0e608fbbc..d704b698a6 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.md +++ b/curriculum/challenges/english/10-coding-interview-prep/data-structures/remove-elements-from-a-linked-list.md @@ -29,7 +29,7 @@ tests: - text: Your remove method should reassign head to the second node when the first node is removed. testString: assert((function(){var test = new LinkedList(); test.add('cat'); test.add('dog'); test.remove('cat'); return test.head().element === 'dog'}())); - text: Your remove method should decrease the length of the linked list by one for every node removed. - testString: assert((function(){var test = new LinkedList(); test.add('cat'); test.add('dog'); test.remove('cat'); return test.size() === 1})()); + testString: assert((function(){var test = new LinkedList(); test.add("cat"); test.add("dog"); test.add("hamster"); test.remove("cat"); test.remove("fish"); return test.size() === 2})()); - text: Your remove method should reassign the reference of the previous node of the removed node to the removed node's next reference. testString: assert((function(){var test = new LinkedList(); test.add('cat'); test.add('dog');test.add('kitten'); test.remove('dog'); return test.head().next.element === 'kitten'})()); - text: Your remove method should not change the linked list if the element does not exist in the linked list.