sv/tests/05_sv_trim_right.c

18 lines
407 B
C
Raw Permalink Normal View History

2025-07-11 00:19:52 +00:00
#define DEBUG
#include "../include/sv.h"
#include "../include/except.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
const char *s = "Hello World";
const char *s1 = "Hello World ";
SV sv = sv_strn(s,strlen(s));
SV sv1 = sv_strn(s1,strlen(s1));
sv1 = sv_trim_right(sv1);
ASSERTED(strncmp(sv.buf,sv1.buf,sv1.len) == 0);
return EXIT_SUCCESS;
}