Yes, its pretty straight forward... test_stripallbut.c could rather bee test_stringtools, and add some more tests... stringbuf_test.c contains several tests hooked into one list if you want to have a look at it...
I like the idea of adding unit tests; perhaps in the future we can write some more that connect to citserver and do things like testing the IMAP service for accuracy etc.
I started using imaptest for that; for deeper tests it require us that syntax extension of <line >{n chars of next line} to be implemented.
I started doing that for the nginx imap proxy...
in general imaptest offers a good set of tools to test imap stuff, plus the author idles in #imap and is pretty responsive to questions.