diff --git a/tests/extra/table.cc b/tests/extra/table.cc index b417cf42..dd6c0232 100644 --- a/tests/extra/table.cc +++ b/tests/extra/table.cc @@ -55,6 +55,8 @@ TEST_CASE("Testing pop_front function for table class") { REQUIRE(t[0] == 50); t.pop_front(); REQUIRE(t.size() == 0); + t.pop_front(); + REQUIRE(t.size() == 0); } TEST_CASE("Testing pop_back fucntion for table class") { @@ -70,6 +72,8 @@ TEST_CASE("Testing pop_back fucntion for table class") { REQUIRE(t[t.size() - 1] == 10); t.pop_back(); REQUIRE(t.size() == 0); + t.pop_back(); + REQUIRE(t.size() == 0); } TEST_CASE("Testing iterators for table class") { @@ -86,6 +90,9 @@ TEST_CASE("Testing operator << for table class") { table t; t.push_back(10, 20, 30, 40, 50); CHECK_NOTHROW(std::cout << t << '\n'); + + table tt; + CHECK_NOTHROW(std::cout << tt << '\n'); } TEST_CASE("Testing operator = for table class"){ @@ -105,3 +112,16 @@ TEST_CASE("Testing copy constructor for table class") { REQUIRE(v1 == v2); REQUIRE(t.size() == tt.size()); } + +TEST_CASE("Testing [] operator for table class") { + table t; + t.push_back(10, 20, 30, 40, 50); + std::vector v { t.vectorize() }; + for(int i = 0; i