Skip to content
Snippets Groups Projects
test.cpp 337 B
Newer Older
Jacek Galowicz's avatar
Jacek Galowicz committed
#include <calc.hpp>

#include <catch2/catch.hpp>

TEST_CASE( "some example calculations", "[calc]") {
  REQUIRE( evaluate("11+") == 2 );
  REQUIRE( evaluate("12+2-3*") == 3 );
TEST_CASE( "pow function works", "[calc]") {
  REQUIRE( evaluate("22^") == 4 );
  REQUIRE( evaluate("43^") == 64 );
  REQUIRE_FALSE( evaluate("11^") == 2);
Jacek Galowicz's avatar
Jacek Galowicz committed
}