19 lines
443 B
C
19 lines
443 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 = "Goodbye World!";
|
||
|
|
|
||
|
|
struct String_View sv = sv_strn(s, strlen(s));
|
||
|
|
struct String_View sv2 = sv_after_delim(sv,",");
|
||
|
|
assert(sv2.len == strlen(s3));
|
||
|
|
assert( memcmp(sv2.buf, s3, sv2.len) == 0);
|
||
|
|
|
||
|
|
return EXIT_SUCCESS;
|
||
|
|
}
|