Both tests fail. Probably str_wrap is wrong - first case, the second line breaks at wrong place. Second case - when string contains \n it is not removed (maybe space parameter should be different?)
stri_wrap_greedy/dynamic - first version
stri_wrap - uses greedy/dynamic function
stri_wrap_g/d - version for C++ implementation
stri_wrapC - uses g/d function