X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftest_wrbuf.c;h=f213561b75f8358e4a27dca3ae5c6aaf27c926c3;hb=eaeb5111f809df907a53890b797c854ecacfdf21;hp=007258a46de6f0fd7a237394fa0a51d2f374ac85;hpb=43a9d38d20c1b1bcd1a03b2445a501d27526bd35;p=yaz-moved-to-github.git diff --git a/test/test_wrbuf.c b/test/test_wrbuf.c index 007258a..f213561 100644 --- a/test/test_wrbuf.c +++ b/test/test_wrbuf.c @@ -54,6 +54,27 @@ static void tstwrbuf(void) } wrbuf_rewind(wr); } + + wrbuf_rewind(wr); + wrbuf_puts(wr, "1234"); + wrbuf_insert(wr, 0, "abc", 3); + YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "abc1234")); + + wrbuf_rewind(wr); + wrbuf_puts(wr, "1234"); + wrbuf_insert(wr, 1, "abc", 3); + YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "1abc234")); + + wrbuf_rewind(wr); + wrbuf_puts(wr, "1234"); + wrbuf_insert(wr, 4, "abc", 3); + YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "1234abc")); + + wrbuf_rewind(wr); + wrbuf_puts(wr, "1234"); + wrbuf_insert(wr, 5, "abc", 3); + YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "1234")); + wrbuf_destroy(wr); }