Skip to content

Commit 7226717

Browse files
committed
test: implement test for cycle detect and mid
1 parent c779b9b commit 7226717

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/testing.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,4 +1055,13 @@ TEST(remove_count,simple_remove_count){
10551055
actual.push_back(x);
10561056
}
10571057
EXPECT_EQ(actual,expectation);
1058-
}
1058+
}
1059+
TEST(getter,cycle_testing){
1060+
forward_lists<int>list = {1,2,3,4};
1061+
EXPECT_FALSE(list.check_cycle());
1062+
}
1063+
TEST(getter,middle_testing){
1064+
forward_lists<int>list = {1,2,3,4,5};
1065+
int mid = list.get_middle();
1066+
EXPECT_EQ(mid,3);
1067+
}

0 commit comments

Comments
 (0)