You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
335 B
C

#include <assert.h>
#include "stralloc.h"
#include "buffer.h"
main() {
static stralloc sa;
stralloc_copys(&sa,"foo\r\n");
assert(sa.len==5);
assert(stralloc_chomp(&sa)==2);
assert(stralloc_chop(&sa)=='o');
assert(stralloc_chop(&sa)=='o');
assert(stralloc_chop(&sa)=='f');
assert(stralloc_chop(&sa)==-1);
return 0;
}