You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
868 B
43 lines
868 B
#ifdef TEST
|
|
|
|
#include "unity.h"
|
|
|
|
#include "inputHandling.h"
|
|
char halloWelt[]="Hallo Welt";
|
|
char halloWelt2[]="Hallo Welt";
|
|
char halloWelt3[]="Ha llo W el t ";
|
|
char halloWelt4[]="Ha\n\nllo \r W el\r\r t ";
|
|
|
|
void setUp(void)
|
|
{
|
|
}
|
|
|
|
void tearDown(void)
|
|
{
|
|
}
|
|
|
|
void test_inputHandling_deleteOneWhiteSpace(void)
|
|
{
|
|
deleteWhitespace(halloWelt, 10);
|
|
TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt);
|
|
}
|
|
|
|
void test_inputHandling_deleteTwoWhiteSpaces(void)
|
|
{
|
|
deleteWhitespace(halloWelt2, 11);
|
|
TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt2);
|
|
}
|
|
|
|
void test_inputHandling_deleteManyWhiteSpaces(void)
|
|
{
|
|
deleteWhitespace(halloWelt3, 16);
|
|
TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt3);
|
|
}
|
|
|
|
void test_inputHandling_deleteAllOtherCharacter(void)
|
|
{
|
|
deleteWhitespace(halloWelt4, 19);
|
|
TEST_ASSERT_EQUAL_STRING("HalloWelt", halloWelt4);
|
|
}
|
|
|
|
#endif // TEST
|