Moved tests + Added more tests + Added memory testing to actions
Run tests / Run tests (push) Failing after 6s
Run tests / Run tests (push) Failing after 6s
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#define EV_STR_IMPLEMENTATION
|
||||
#include "ev_str.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const evstring stack_str = evstr("Stack 'Hello, World!'");
|
||||
|
||||
evstring_view view = evstring_slice(stack_str, 0, -1);
|
||||
assert(view.data == stack_str);
|
||||
assert(view.offset == 0);
|
||||
assert(view.len == evstring_getLength(stack_str));
|
||||
|
||||
evstring heap_str = evstring_new(view);
|
||||
assert(heap_str != NULL);
|
||||
assert(strcmp(heap_str, stack_str) == 0);
|
||||
assert(evstring_getLength(heap_str) == evstring_getLength(stack_str));
|
||||
|
||||
evstring_free(heap_str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user