Multiple Changes
This commit is contained in:
+25
@@ -77,5 +77,30 @@ int main()
|
||||
evstring_free(heap_str);
|
||||
}
|
||||
|
||||
{ // Incorrectly handled mismatches
|
||||
evstring text = evstr("aab");
|
||||
evstring query = evstr("ab");
|
||||
evstring_view match = evstring_findFirst(text, query);
|
||||
assert(match.len == 2);
|
||||
assert(match.offset == 1);
|
||||
}
|
||||
|
||||
{ // Underflowing getSpace for stack strings
|
||||
evstring stack_str = evstr("abc");
|
||||
assert(evstring_getSpace(stack_str) == 0);
|
||||
}
|
||||
|
||||
{ // Overlapping push
|
||||
evstring s = evstring_newFromStr("abc");
|
||||
assert(s != NULL);
|
||||
|
||||
evstring_error_t err = evstring_pushStr(&s, s);
|
||||
assert(err == EV_STR_ERR_NONE);
|
||||
assert(strcmp(s, "abcabc") == 0);
|
||||
|
||||
evstring_free(s);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user