All tests done, final commit, just need to do the doxygen files
This commit is contained in:
@@ -301,3 +301,25 @@ TEST_CASE("Insert at end of list", "[linkedlist]") {
|
||||
REQUIRE(list.len() == 4);
|
||||
REQUIRE(list.get(2) == 90);
|
||||
}
|
||||
|
||||
TEST_CASE("Insert at middle of list", "[linkedlist]") {
|
||||
LinkedList<int> list = {};
|
||||
|
||||
REQUIRE(list.len() == 0);
|
||||
|
||||
list.append(8);
|
||||
REQUIRE(list.len() == 1);
|
||||
REQUIRE(list.get(0) == 8);
|
||||
|
||||
list.append(9);
|
||||
REQUIRE(list.len() == 2);
|
||||
REQUIRE(list.get(1) == 9);
|
||||
|
||||
list.append(10);
|
||||
REQUIRE(list.len() == 3);
|
||||
REQUIRE(list.get(2) == 10);
|
||||
|
||||
list.insert(1, 90);
|
||||
REQUIRE(list.len() == 4);
|
||||
REQUIRE(list.get(1) == 90);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user