From bdad9560be676db877bdbcd0350d525a5d7de134 Mon Sep 17 00:00:00 2001 From: Sophia Weber Date: Sun, 28 Jan 2024 14:19:51 +0100 Subject: [PATCH] Implement div detected Test for getNumber Function --- test/test_inputHandling.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_inputHandling.c b/test/test_inputHandling.c index 0b666e9..404d840 100644 --- a/test/test_inputHandling.c +++ b/test/test_inputHandling.c @@ -135,4 +135,18 @@ void test_inputHandling_getNumbersMultiFormular(void) TEST_ASSERT_EQUAL_DOUBLE(5.0, formula.inputNumbers[1]); TEST_ASSERT_EQUAL_INT(2, formula.arrayLength); } + +void test_inputHandling_getNumbersDivFormular(void) +{ + char* pnt = NULL; + char div[] = "4/5"; + formula.functionsType = detectFunctionOperator(div,3); + TEST_ASSERT_TRUE(formula.functionsType == opDiv); + pnt = getNumbers(div, 3, &formula); + showStruct(&formula); + TEST_ASSERT_NULL(pnt); + TEST_ASSERT_EQUAL_DOUBLE(4.0, formula.inputNumbers[0]); + TEST_ASSERT_EQUAL_DOUBLE(5.0, formula.inputNumbers[1]); + TEST_ASSERT_EQUAL_INT(2, formula.arrayLength); +} #endif // TEST