// // test insertBefore() member function. // // assumes constructors work. // // assumes lstring is implemented using a Seq as the first/only // member variable. // #include #include // has EXIT_SUCCESS #include "lstring.h" #include "testsub.h" // has functions for testing int main(void) { lstring empty1; lstring empty2; lstring wxyz("wxyz"); lstring ab("ab"); lstring cd("cd"); lstring efgh("efgh"); empty1.insertBefore(wxyz, 0); printWithMsg("insert 'wxyz' into '' at 0: ", empty1); wxyz.insertBefore(empty2, 1); printWithMsg("insert '' into 'wxyz' at 1: ", wxyz); wxyz.insertBefore(ab, 0); printWithMsg("insert 'ab' into result at 0: ", wxyz); wxyz.insertBefore(efgh, 2); printWithMsg("insert 'efgh' into result at 2: ", wxyz); wxyz.insertBefore(cd, 10); printWithMsg("insert 'cd' into result at 10: ", wxyz); cout << "That's all, folks!\n"; return EXIT_SUCCESS; }