Skip to content
Snippets Groups Projects
Commit b3c53207 authored by Jacek Galowicz's avatar Jacek Galowicz
Browse files

Merge branch 'master' into 'master'

basic calculus tests

See merge request jg943598/rpn_collab!4
parents 28656afc 34f12ab1
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,26 @@ TEST_CASE( "some example calculations", "[calc]") {
REQUIRE( evaluate("12+2-3*") == 3 );
}
TEST_CASE( "basic addition", "[calc]"){
REQUIRE( evaluate("55+") == 10);
REQUIRE( evaluate("34+") == 7);
}
TEST_CASE( "basic subtraction", "[calc]"){
REQUIRE( evaluate("55-") == 0);
REQUIRE( evaluate("83-") == 5);
}
TEST_CASE( "basic multiplication", "[calc]"){
REQUIRE( evaluate("55*") == 25);
REQUIRE( evaluate("36*") == 18);
}
TEST_CASE( "basic division", "[calc]"){
REQUIRE( evaluate("55/") == 1);
REQUIRE( evaluate("93/") == 3);
}
TEST_CASE( "Test modulo function", "[calc]") {
REQUIRE( evaluate("11%") == 0 );
REQUIRE( evaluate("32%") == 1 );
......
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