From c7020d6739ce341415803489ea2913c1fa57361c Mon Sep 17 00:00:00 2001 From: LaEntropiaa Date: Sat, 21 Mar 2026 23:29:48 -0600 Subject: [PATCH] All tests done, final commit, just need to do the doxygen files --- test/test_linkedlist.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test_linkedlist.cpp b/test/test_linkedlist.cpp index 091337c..f2549fd 100644 --- a/test/test_linkedlist.cpp +++ b/test/test_linkedlist.cpp @@ -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 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); +}