Browse Source

added test for gets wit minLength and maxLength

remotes/origin/userinput
TheUltimateOptimist 11 months ago
parent
commit
bd40855b6c
  1. 16
      test/test_userinput.c

16
test/test_userinput.c

@ -0,0 +1,16 @@
#include "unity.h"
#include "userinput.h"
#include "fakeinput.h"
#include <string.h>
void setUp(void){}
void tearDown(void){}
void test_gets_WithMinLengthAndMaxLength(void) {
unsigned long minLength = 3;
unsigned long maxLength = 10;
char *input[] = {"ei", "e", "sddfdfdfdfdf", "dddd", NULL};
fakeInput = input;
char *actual = gets("", &minLength, &maxLength);
TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual));
}
Loading…
Cancel
Save