diff --git a/test/test_userinput.c b/test/test_userinput.c index b0d6bac..b247b6b 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -61,6 +61,13 @@ void test_getd_WithMin(void) { TEST_ASSERT_EQUAL_INT64(10000000, getd("", &min, NULL)); } +void test_getd_WithMax(void) { + int max = 1000; + char *input[] = {"sdf", "4000", "10000000", "-200", NULL}; + fakeInput = input; + TEST_ASSERT_EQUAL_INT64(-200, getd("", NULL, &max)); +} + void test_getld_WithMinAndMax(void) { long min = -100; long max = 100000000;