Initial commit
This commit is contained in:
18
tests/09_after_delims.c
Normal file
18
tests/09_after_delims.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user