From dd4a83fc597e4f5d498d9029637b18b2816a1e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 16 Nov 2018 14:06:37 +0100 Subject: [PATCH] [poincare] Store: add tests on composed functions --- poincare/test/store.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/poincare/test/store.cpp b/poincare/test/store.cpp index 2d84505d1..e2e30feeb 100644 --- a/poincare/test/store.cpp +++ b/poincare/test/store.cpp @@ -199,6 +199,12 @@ QUIZ_CASE(poincare_store_composed_functions) { assert_parsed_expression_evaluates_to("g(3)+[[1]]", "[[18]]"); assert_parsed_expression_evaluates_to("g(5)", "45"); + // g: x->x+1 + assert_simplify("x+1>g(x)"); + assert_parsed_expression_evaluates_to("f(g(4))", "25"); + // Add a matrix to bypass simplification + assert_parsed_expression_evaluates_to("f(g(4))+[[1]]", "[[26]]"); + // Clean the storage for other tests Ion::Storage::sharedStorage()->recordNamed("f.func").destroy(); Ion::Storage::sharedStorage()->recordNamed("g.func").destroy();