#include #include #include #include #include "helper.h" using namespace Poincare; QUIZ_CASE(poincare_subtraction_evaluate) { assert_parsed_expression_evaluates_to("1-2", "-1"); assert_parsed_expression_evaluates_to("3+I-(4+I)", "-1"); #if MATRICES_ARE_DEFINED assert_parsed_expression_evaluates_to("[[1,2][3,4][5,6]]-3", "[[-2,-1][0,1][2,3]]"); assert_parsed_expression_evaluates_to("[[1,2+I][3,4][5,6]]-(4+I)", "[[(-3)-I,-2][(-1)-I,-I][1-I,2-I]]"); assert_parsed_expression_evaluates_to("3-[[1,2][3,4][5,6]]", "[[2,1][0,-1][-2,-3]]"); assert_parsed_expression_evaluates_to("3+I-[[1,2+I][3,4][5,6]]", "[[2+I,1][I,(-1)+I][(-2)+I,(-3)+I]]"); assert_parsed_expression_evaluates_to("[[1,2][3,4][5,6]]-[[6,5][4,3][2,1]]", "[[-5,-3][-1,1][3,5]]"); assert_parsed_expression_evaluates_to("[[1,2+I][3,4][5,6]]-[[1,2+I][3,4][5,6]]", "[[0,0][0,0][0,0]]"); #endif }