16 lines
331 B
C
16 lines
331 B
C
|
|
#define DEBUG
|
||
|
|
#include <stdlib.h>
|
||
|
|
#include <assert.h>
|
||
|
|
#include <string.h>
|
||
|
|
#include "../include/sv.h"
|
||
|
|
|
||
|
|
int main(void){
|
||
|
|
const char *s = "Hello World!";
|
||
|
|
SV sv = sv_strn(s, strlen(s));
|
||
|
|
|
||
|
|
assert(sv.buf != NULL);
|
||
|
|
assert(strlen(s) == sv.len);
|
||
|
|
assert( memcmp(sv.buf, s, strlen(s) ) == 0);
|
||
|
|
return EXIT_SUCCESS;
|
||
|
|
}
|