Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. {
  2. fprintf(stderr, "-----------------------------------------\n"
  3. " formRichText tests \n"
  4. "-----------------------------------------\n");
  5.  
  6.  
  7. //-----------------------------------------------------------------
  8. //------------------------- GENERAL CASE --------------------------
  9. //-----------------------------------------------------------------
  10. fprintf(stderr, "\t--> 1: General Case\n");
  11.  
  12. // Calling dumpTB immediately after newTB, without modifying the TB
  13. TB tb1 = newTB("*some string\n*some string*lol*\n*some_string*again_\n*some* _string_\nsome *string_again_\nsome#string*once_again*\n#string_stuff_\n#\n###\n");
  14. formRichText(tb1);
  15. char *text1 = dumpTB(tb1, false);
  16. char *text1exp = "*some string\n<b>some string</b>lol*\n<b>some_string</b>again_\n<b>some</b> <i>string</i>\nsome *string<i>again</i>\nsome#string<b>once_again</b>\n<h1>string_stuff_</h1>\n#\n<h1>##</h1>\n";
  17.  
  18. //debugging output for dumpTB test
  19. #ifdef DEBUG
  20. text_difference(text1, text1exp);
  21. #endif
  22.  
  23. assert(strcmp(text1exp, text1) == 0);
  24. free(text1);
  25. releaseTB(tb1);
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement