mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 15:20:39 +01:00
[test/calculation] 1+1->a shoud display 2, not 1+1=2
This commit is contained in:
@@ -106,9 +106,9 @@ QUIZ_CASE(calculation_display_exact_approximate) {
|
||||
assertCalculationDisplay("28^7", false, false, ::Calculation::Calculation::EqualSign::Unknown, nullptr, nullptr, &globalContext, &store);
|
||||
assertCalculationDisplay("3+R(2)>a", false, false, ::Calculation::Calculation::EqualSign::Approximation, "R(2)+3", nullptr, &globalContext, &store);
|
||||
Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy();
|
||||
assertCalculationDisplay("3+2>a", false, false, ::Calculation::Calculation::EqualSign::Equal, "3+2", "5", &globalContext, &store);
|
||||
assertCalculationDisplay("3+2>a", false, true, ::Calculation::Calculation::EqualSign::Equal, "5", "5", &globalContext, &store);
|
||||
Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy();
|
||||
assertCalculationDisplay("3>a", false, true, ::Calculation::Calculation::EqualSign::Unknown, nullptr, "3", &globalContext, &store);
|
||||
assertCalculationDisplay("3>a", false, true, ::Calculation::Calculation::EqualSign::Equal, "3", "3", &globalContext, &store);
|
||||
Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy();
|
||||
assertCalculationDisplay("3+x>f(x)", true, false, ::Calculation::Calculation::EqualSign::Unknown, "x+3", nullptr, &globalContext, &store);
|
||||
Ion::Storage::sharedStorage()->recordNamed("f.func").destroy();
|
||||
|
||||
@@ -15,17 +15,17 @@ QUIZ_CASE(poincare_store_evaluate) {
|
||||
}
|
||||
|
||||
QUIZ_CASE(poincare_store_simplify) {
|
||||
assert_parsed_expression_simplify_to("1+2>A", "2+1");
|
||||
assert_parsed_expression_simplify_to("1+2>x", "2+1");
|
||||
assert_parsed_expression_simplify_to("1+2>x", "3");
|
||||
assert_parsed_expression_simplify_to("0.1+0.2>x", "3/10");
|
||||
assert_parsed_expression_simplify_to("a+a>x", "2*a");
|
||||
|
||||
// Clean the storage for other tests
|
||||
Ion::Storage::sharedStorage()->recordNamed("A.exp").destroy();
|
||||
Ion::Storage::sharedStorage()->recordNamed("x.exp").destroy();
|
||||
}
|
||||
|
||||
QUIZ_CASE(poincare_store_matrix) {
|
||||
assert_parsed_expression_evaluates_to<double>("[[7]]>a", "[[7]]");
|
||||
assert_parsed_expression_simplify_to("1+1>a", "1+1");
|
||||
assert_parsed_expression_simplify_to("1+1>a", "2");
|
||||
|
||||
// Clean the storage for other tests
|
||||
Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy();
|
||||
@@ -54,7 +54,7 @@ QUIZ_CASE(poincare_store_overwrite) {
|
||||
|
||||
QUIZ_CASE(poincare_store_do_not_overwrite) {
|
||||
assert_parsed_expression_simplify_to("-1>g(x)", "-1");
|
||||
assert_parsed_expression_simplify_to("1+g(x)>f(x)", "g(x)+1");
|
||||
assert_parsed_expression_simplify_to("1+g(x)>f(x)", "0");
|
||||
assert_parsed_expression_simplify_to("2>g", Undefined::Name());
|
||||
assert_parsed_expression_evaluates_to<double>("g(4)", "-1");
|
||||
assert_parsed_expression_evaluates_to<double>("f(4)", "0");
|
||||
|
||||
@@ -8,7 +8,7 @@ using namespace Poincare;
|
||||
|
||||
QUIZ_CASE(poincare_user_variable_simple) {
|
||||
// Fill variable
|
||||
assert_parsed_expression_simplify_to("1+2>Adadas", "2+1");
|
||||
assert_parsed_expression_simplify_to("1+2>Adadas", "3");
|
||||
assert_parsed_expression_simplify_to("Adadas", "3");
|
||||
|
||||
// Fill f1
|
||||
@@ -22,7 +22,7 @@ QUIZ_CASE(poincare_user_variable_simple) {
|
||||
assert_parsed_expression_simplify_to("f2(Adadas)", "2");
|
||||
|
||||
// Define fBoth with f1 and f2
|
||||
assert_parsed_expression_simplify_to("f1(x)+f2(x)>fBoth(x)", "f1(x)+f2(x)");
|
||||
assert_parsed_expression_simplify_to("f1(x)+f2(x)>fBoth(x)", "2*x");
|
||||
assert_parsed_expression_simplify_to("fBoth(4)", "8");
|
||||
assert_parsed_expression_simplify_to("fBoth(Adadas)", "6");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user