Skip to content
Snippets Groups Projects
Commit b993766a authored by Sebastian Staffa's avatar Sebastian Staffa
Browse files

Add evaluate tests

parent 17399bf1
No related branches found
No related tags found
No related merge requests found
......@@ -34,3 +34,12 @@ TEST_CASE("divide-function work as designed", "[mathemathic-operations]") {
REQUIRE(divide(6,-2) == -3);
}
TEST_CASE("Evaluate Function for basic Functionality","[evaluate]") {
REQUIRE( evaluate("23+") == 5 );
REQUIRE_THROWS_AS( evaluate("2%"), std::invalid_argument );
REQUIRE_THROWS_AS( evaluate("2+"), std::invalid_argument );
REQUIRE_THROWS_AS( evaluate("20/"), std::invalid_argument );
REQUIRE_THROWS_AS( evaluate(""), std::invalid_argument );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment