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

#include <catch2/catch.hpp>

Steven Waleska's avatar
Steven Waleska committed
TEST_CASE( "basic calculus", "[calc]") {
Jacek Galowicz's avatar
Jacek Galowicz committed
  REQUIRE( evaluate("11+") == 2 );
  REQUIRE( evaluate("12+2-3*") == 3 );
Steven Waleska's avatar
Steven Waleska committed
  REQUIRE( evaluate("21-") == 1);
  REQUIRE( evaluate("42/") == 2); 
  REQUIRE( evaluate("22*") == 4);
Jacek Galowicz's avatar
Jacek Galowicz committed
}