Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.List;
import org.junit.*;

public class LinkedListTest {
public class DoublyLinkedListTest {

static final int LOOPS = 10000;
static final int TEST_SZ = 40;
Expand Down Expand Up @@ -305,6 +305,13 @@ public void testRandomizedIndexOf() {
}
}

@Test
public void testContains() {
list.add(1);
assertTrue(list.contains(1));
assertFalse(list.contains(2));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to assert the linked list does not contain a certain value because there are an infinite number of numbers it does not contain. Perhaps check the size instead?

}

// Generate a list of random numbers
static List<Integer> genRandList(int sz) {
List<Integer> lst = new ArrayList<>(sz);
Expand Down