mirror of
https://github.com/troglobit/libite.git
synced 2026-11-10 16:31:15 +00:00
Add unit test for chomp()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
75d4edb424
commit
682b662bd5
5 files changed
+26
-14
No files matched your search
@@ -45,18 +45,8 @@ char *chomp(char *str)
|
||||
return str;
|
||||
}
|
||||
|
||||
#ifdef UNITTEST
|
||||
#include <stdio.h>
|
||||
int main(void)
|
||||
{
|
||||
int i; char t[][16] = { "hej\ndej", "Slime\n\n\\n", "Tripple\n\n\n", "" };
|
||||
for (i = 0; t[i][0]; i++) printf("[%02d]: '%s'\n", i, chomp(t[i])); return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f chomp.mk"
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
Reference in new issue
Block a user