Changeset e5c9d3de for tester.c


Ignore:
Timestamp:
Aug 7, 2010, 12:55:44 AM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
335413f1
Parents:
5ca3fb7
git-author:
David Benjamin <davidben@mit.edu> (08/07/10 00:47:45)
git-committer:
David Benjamin <davidben@mit.edu> (08/07/10 00:55:44)
Message:
Add a test for owl_editwin_move_to_beginning_of_line

We currently incorrectly handle buffers which begin with an empty line.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    re0022d2 re5c9d3de  
    405405  owl_editwin_delete(oe); oe = NULL;
    406406
     407  /* Test owl_editwin_move_to_beginning_of_line. */
     408  oe = owl_editwin_new(NULL, 80, 80, OWL_EDITWIN_STYLE_MULTILINE, NULL);
     409  owl_editwin_insert_string(oe, "\n");
     410  owl_editwin_insert_string(oe, "12345678\n");
     411  owl_editwin_insert_string(oe, "\n");
     412  owl_editwin_insert_string(oe, "abcdefg\n");
     413  owl_editwin_move_to_top(oe);
     414  FAIL_UNLESS("already at beginning of line",
     415              owl_editwin_move_to_beginning_of_line(oe) == 0);
     416  owl_editwin_line_move(oe, 1);
     417  owl_editwin_point_move(oe, 5);
     418  FAIL_UNLESS("find beginning of line after empty first line",
     419              owl_editwin_move_to_beginning_of_line(oe) == -5);
     420  owl_editwin_line_move(oe, 1);
     421  FAIL_UNLESS("find beginning empty middle line",
     422              owl_editwin_move_to_beginning_of_line(oe) == 0);
     423  owl_editwin_line_move(oe, 1);
     424  owl_editwin_point_move(oe, 2);
     425  FAIL_UNLESS("find beginning of line after empty middle line",
     426              owl_editwin_move_to_beginning_of_line(oe) == -2);
     427  owl_editwin_delete(oe); oe = NULL;
     428
    407429  printf("# END testing owl_editwin (%d failures)\n", numfailed);
    408430
Note: See TracChangeset for help on using the changeset viewer.