new strops_length and strops_copy
This commit is contained in:
35
tests.c
35
tests.c
@ -57,6 +57,38 @@ int test_() {
|
||||
}
|
||||
*/
|
||||
|
||||
int test_contains_char() {
|
||||
int ret = 1;
|
||||
char* input;
|
||||
char expected;
|
||||
char result;
|
||||
input = "string";
|
||||
expected = 1;
|
||||
result = strops_contains_char(input, 'i');
|
||||
if (result != expected) {
|
||||
printf("test_ failed\n");
|
||||
printf("Got = %d\nExpected = %d\n", result, expected);
|
||||
ret = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int test_contains_string() {
|
||||
int ret = 1;
|
||||
char* input;
|
||||
char expected;
|
||||
char result;
|
||||
input = "I suck at C";
|
||||
expected = 1;
|
||||
result = strops_contains_string(input, "C");
|
||||
if (result != expected) {
|
||||
printf("test_ failed\n");
|
||||
printf("Got = %d\nExpected = %d\n", result, expected);
|
||||
ret = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int test_to_lowercase() {
|
||||
int ret = 1;
|
||||
char* input;
|
||||
@ -506,6 +538,9 @@ int test_url_decode() {
|
||||
|
||||
int main() {
|
||||
Tests tests = { 0 };
|
||||
|
||||
da_append(&tests, test_contains_char);
|
||||
da_append(&tests, test_contains_string);
|
||||
|
||||
da_append(&tests, test_to_lowercase);
|
||||
da_append(&tests, test_to_uppercase);
|
||||
|
Reference in New Issue
Block a user