#include #include #include #include #include #include "helper.h" using namespace Poincare; QUIZ_CASE(poincare_parser) { assert_parsed_expression_evaluates_to("-2-3", "-5"); assert_parsed_expression_evaluates_to("1.2*X^(1)", "3.261938"); assert_parsed_expression_evaluates_to("X^2*X^(1)", "20.0855", Radian, Cartesian, 6); // WARNING: the 7th significant digits is wrong on simulator assert_parsed_expression_evaluates_to("X^2*X^(1)", "20.085536923188"); assert_parsed_expression_evaluates_to("2*3^4+2", "164"); assert_parsed_expression_evaluates_to("-2*3^4+2", "-160"); assert_parsed_expression_evaluates_to("-sin(3)*2-3", "-3.2822400161197", Radian); assert_parsed_expression_evaluates_to("-.003", "-0.003"); assert_parsed_expression_evaluates_to(".02E2", "2"); assert_parsed_expression_evaluates_to("5-2/3", "4.333333"); assert_parsed_expression_evaluates_to("2/3-5", "-4.3333333333333"); assert_parsed_expression_evaluates_to("-2/3-5", "-5.666667"); assert_parsed_expression_evaluates_to("sin(3)2(4+2)", "1.6934400967184", Radian); assert_parsed_expression_evaluates_to("4/2*(2+3)", "10"); assert_parsed_expression_evaluates_to("4/2*(2+3)", "10"); }