Changeset 2b83ad6 for tester.c


Ignore:
Timestamp:
Jul 31, 2010, 7:12:15 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
30da473
Parents:
c93b8b5
git-author:
David Benjamin <davidben@mit.edu> (07/25/10 18:36:54)
git-committer:
David Benjamin <davidben@mit.edu> (07/31/10 19:12:15)
Message:
Add owl_fmtext_expand_tabs with test case
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    r6772d19 r2b83ad6  
    470470  owl_free(str);
    471471
     472  /* Test owl_fmtext_expand_tabs. */
     473  owl_fmtext_clear(&fm1);
     474  owl_fmtext_append_normal(&fm1, "12\t1234");
     475  owl_fmtext_append_bold(&fm1, "567\t1\n12345678\t1");
     476  owl_fmtext_clear(&fm2);
     477  owl_fmtext_expand_tabs(&fm1, &fm2, 0);
     478  str = owl_fmtext_print_plain(&fm2);
     479  FAIL_UNLESS("no tabs remaining", strchr(str, '\t') == NULL);
     480  FAIL_UNLESS("tabs corrected expanded",
     481              str && !strcmp(str, "12      1234567 1\n"
     482                                  "12345678        1"));
     483  owl_free(str);
     484
     485  owl_fmtext_clear(&fm2);
     486  owl_fmtext_expand_tabs(&fm1, &fm2, 1);
     487  str = owl_fmtext_print_plain(&fm2);
     488  FAIL_UNLESS("no tabs remaining", strchr(str, '\t') == NULL);
     489  FAIL_UNLESS("tabs corrected expanded",
     490              str && !strcmp(str, "12     1234567 1\n"
     491                                  "12345678       1"));
     492  owl_free(str);
     493
    472494  owl_fmtext_cleanup(&fm1);
    473495  owl_fmtext_cleanup(&fm2);
Note: See TracChangeset for help on using the changeset viewer.