Files
evol-headers/tests/ev_str/push_fmt_float.c
T
2026-05-03 20:07:16 +03:00

26 lines
652 B
C

#define EV_STR_IMPLEMENTATION
#include "ev_str.h"
#include <assert.h>
#include <string.h>
int main(void)
{
evstring heap_str = evstring_new("Heap 'Hello, World!'");
assert(heap_str != NULL);
evstring_error_t res = evstring_push(&heap_str, "%.05f", 1.0f);
assert(res == EV_STR_ERR_NONE);
assert(evstring_getLength(heap_str) == 27);
assert(strcmp(heap_str, "Heap 'Hello, World!'1.00000") == 0);
res = evstring_push(&heap_str, "Something");
assert(res == EV_STR_ERR_NONE);
assert(evstring_getLength(heap_str) == 36);
assert(strcmp(heap_str, "Heap 'Hello, World!'1.00000Something") == 0);
evstring_free(heap_str);
return 0;
}