Changeset 4cc02605
- Timestamp:
- Oct 24, 2009, 12:59:25 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- f9d257b
- Parents:
- 6211c76
- git-author:
- David Benjamin <davidben@mit.edu> (10/19/09 18:55:11)
- git-committer:
- David Benjamin <davidben@mit.edu> (10/24/09 12:59:25)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester.c
r23fddad r4cc02605 12 12 int owl_filter_regtest(void); 13 13 int owl_obarray_regtest(void); 14 int owl_editwin_regtest(void); 14 15 15 16 int main(int argc, char **argv, char **env) … … 29 30 numfailures += owl_filter_regtest(); 30 31 numfailures += owl_obarray_regtest(); 32 numfailures += owl_editwin_regtest(); 31 33 if (numfailures) { 32 34 fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures); … … 311 313 return numfailed; 312 314 } 315 316 int owl_editwin_regtest(void) { 317 int numfailed = 0; 318 const char *p; 319 320 printf("# BEGIN testing owl_editwin\n"); 321 322 owl_editwin *oe; 323 oe = owl_editwin_allocate(); 324 owl_editwin_init(oe, NULL, 80, 80, OWL_EDITWIN_STYLE_MULTILINE, NULL); 325 326 /* TODO: make the strings a little more lenient w.r.t trailing whitespace */ 327 328 /* check paragraph fill */ 329 owl_editwin_insert_string(oe, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.\n\nblah"); 330 owl_editwin_move_to_top(oe); 331 owl_editwin_fill_paragraph(oe); 332 p = owl_editwin_get_text(oe); 333 FAIL_UNLESS("text was correctly wrapped", p && !strcmp(p, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n" 334 "blah blah blah.\n" 335 "\n" 336 "blah")); 337 338 /* check that lines ending with ". " correctly fill */ 339 owl_editwin_fullclear(oe); 340 owl_editwin_insert_string(oe, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. \n\nblah"); 341 owl_editwin_move_to_top(oe); 342 owl_editwin_fill_paragraph(oe); 343 p = owl_editwin_get_text(oe); 344 FAIL_UNLESS("text was correctly wrapped", p && !strcmp(p, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n" 345 "blah blah blah. \n" 346 "\n" 347 "blah")); 348 349 owl_editwin_free(oe); 350 351 printf("# END testing owl_editwin (%d failures)\n", numfailed); 352 353 return numfailed; 354 }
Note: See TracChangeset
for help on using the changeset viewer.