From fb5a121d40e3cca7e97129a42d2774a187834b8d Mon Sep 17 00:00:00 2001 From: TheUltimateOptimist Date: Mon, 29 Jan 2024 02:05:25 +0100 Subject: [PATCH] added test for gethd with min and max --- test/test_userinput.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_userinput.c b/test/test_userinput.c index f41c11d..3c2e9c8 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -13,4 +13,12 @@ void test_gets_WithMinLengthAndMaxLength(void) { fakeInput = input; char *actual = gets("", &minLength, &maxLength); TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); +} + +void test_gethd_WithMinAndMax(void) { + short min = 10; + short max = 100; + char *input[] = {"sdf", "1", "101", "50"}; + fakeInput = input; + TEST_ASSERT_EQUAL_INT64(50, gethd("", &min, &max)); } \ No newline at end of file