Changeset ac6d4e4 for tester.c


Ignore:
Timestamp:
Sep 30, 2010, 8:07:17 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
385cce2
Parents:
9c3f334
git-author:
David Benjamin <davidben@mit.edu> (09/29/10 15:41:28)
git-committer:
David Benjamin <davidben@mit.edu> (09/30/10 20:07:17)
Message:
Cache the current column to avoid repeatly recomputing it

In particular, we appropriately update it when inserting characters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    r58a16cc rac6d4e4  
    450450  owl_global_set_edit_maxwrapcols(&g, 70);
    451451
     452  /* Test owl_editwin_current_column. */
     453  oe = owl_editwin_new(NULL, 80, 80, OWL_EDITWIN_STYLE_MULTILINE, NULL);
     454  FAIL_UNLESS("initial column zero", owl_editwin_current_column(oe) == 0);
     455  owl_editwin_insert_string(oe, "abcdef");
     456  FAIL_UNLESS("simple insert", owl_editwin_current_column(oe) == 6);
     457  owl_editwin_insert_string(oe, "\t");
     458  FAIL_UNLESS("insert tabs", owl_editwin_current_column(oe) == 8);
     459  owl_editwin_insert_string(oe, "123\n12\t3");
     460  FAIL_UNLESS("newline with junk", owl_editwin_current_column(oe) == 9);
     461  owl_editwin_move_to_beginning_of_line(oe);
     462  FAIL_UNLESS("beginning of line", owl_editwin_current_column(oe) == 0);
     463  owl_editwin_unref(oe); oe = NULL;
     464
    452465  printf("# END testing owl_editwin (%d failures)\n", numfailed);
    453466
Note: See TracChangeset for help on using the changeset viewer.