From 602064980742dc645bbeeac00c4b3e09244a46e2 Mon Sep 17 00:00:00 2001 From: TheUltimateOptimist Date: Mon, 29 Jan 2024 02:39:10 +0100 Subject: [PATCH] added test for gets with any length --- test/test_userinput.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_userinput.c b/test/test_userinput.c index dbfca67..4965bab 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -31,6 +31,13 @@ void test_gets_WithMax(void) { TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); } +void test_gets_WithAnyLength(void) { + char *input[] = {"dfdfdfdf", NULL}; + fakeInput = input; + char *actual = gets("", NULL, NULL); + TEST_ASSERT_EQUAL_CHAR_ARRAY("dfdfdfdf", actual, strlen(actual)); +} + void test_gethd_WithMinAndMax(void) { short min = 10; short max = 100;