23 lines
572 B
C
23 lines
572 B
C
#define DEBUG
|
|
#include "../include/sv.h"
|
|
#include "../include/except.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main(void){
|
|
const char *haystack = "Hello World, this is a test.";
|
|
const char *needle = "World,";
|
|
const char *result = "World, this is a test.";
|
|
|
|
SV sv_haystack = sv_strn(haystack,strlen(haystack));
|
|
SV sv_needle = sv_strn(needle,strlen(needle));
|
|
SV sv_res = sv_strn(result,strlen(result));
|
|
|
|
SV test = sv_strstr(sv_haystack,sv_needle);
|
|
|
|
ASSERTED(sv_cmp(sv_res,test) == 0);
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|