Files
sv/tests/08_sv_before_delims.c
2026-01-17 12:19:24 -06:00

19 lines
442 B
C

#define DEBUG
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include "../include/sv.h"
int main(void){
const char *s = "Hello World!,Goodbye World!";
const char *s3 = "Hello World!";
struct String_View sv = sv_strn(s, strlen(s));
struct String_View sv2 = sv_before_delim(sv,",");
assert(sv2.len == strlen(s3));
assert( memcmp(sv2.buf, s3, sv2.len) == 0);
return EXIT_SUCCESS;
}