From e5b5214412dc103f2be189883fb5337fdb55bcda Mon Sep 17 00:00:00 2001 From: Aleksei Chubukov Date: Sun, 3 Dec 2023 18:47:05 +0400 Subject: [PATCH] update tests --- tests/test_ft_utils.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/test_ft_utils.c b/tests/test_ft_utils.c index 8ceb9a7..19bf57c 100644 --- a/tests/test_ft_utils.c +++ b/tests/test_ft_utils.c @@ -6,7 +6,7 @@ /* By: achubuko +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/02 22:12:42 by achubuko #+# #+# */ -/* Updated: 2023/12/02 23:51:18 by achubuko ### ########.fr */ +/* Updated: 2023/12/03 18:44:35 by achubuko ### ########.fr */ /* */ /* ************************************************************************** */ #include "unity.h" @@ -21,6 +21,21 @@ void tearDown(void) { } +void test_ft_str_is_numeric_num(void) +{ + TEST_ASSERT_EQUAL_INT(1, ft_str_is_numeric("42")); +} + +void test_ft_str_is_numeric_nonnum(void) +{ + TEST_ASSERT_EQUAL_INT(0, ft_str_is_numeric("asd")); +} + +void test_ft_str_is_numeric_neg(void) +{ + TEST_ASSERT_EQUAL_INT(-1, ft_str_is_numeric("-42")); +} + void test_ft_strlen(void) { char *f; @@ -38,6 +53,9 @@ int main(void) { UNITY_BEGIN(); RUN_TEST(test_ft_strlen); + RUN_TEST(test_ft_str_is_numeric_num); + RUN_TEST(test_ft_str_is_numeric_nonnum); + RUN_TEST(test_ft_str_is_numeric_neg); RUN_TEST(test_ft_atoui32_42); return (UNITY_END()); }