diff --git a/test/test_userinput.c b/test/test_userinput.c index 38f0964..d2129ea 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -15,6 +15,14 @@ void test_gets_WithMinLengthAndMaxLength(void) { TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); } +void test_gets_WithMin(void) { + unsigned long minLength = 3; + char *input[] = {"", "ei", "e", "dddd", NULL}; + fakeInput = input; + char *actual = gets("", &minLength, NULL); + TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); +} + void test_gethd_WithMinAndMax(void) { short min = 10; short max = 100;