summaryrefslogtreecommitdiffstats
path: root/test/textbox-test.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-10-25 21:19:39 +0200
committerDave Davenport <qball@gmpclient.org>2016-10-25 21:19:39 +0200
commita38ac9caf3c17d1f92cbc8696c39644d6a74241f (patch)
tree320178ee139f531f1d8325e5c1ef4341ceacf5ba /test/textbox-test.c
parent8a186726f8fa8f2015c1faa9db0d34fe2eb13cfd (diff)
Update scrollbar behaviour, so dragging is more natural. (limit range from hw/2 to h-hw/2)
Diffstat (limited to 'test/textbox-test.c')
-rw-r--r--test/textbox-test.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/test/textbox-test.c b/test/textbox-test.c
index fc5209ca..3fa33344 100644
--- a/test/textbox-test.c
+++ b/test/textbox-test.c
@@ -88,9 +88,9 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
TASSERT ( strcmp ( box->text, "tesb" ) == 0 );
textbox_keybinding ( box, MOVE_CHAR_BACK );
TASSERT ( box->cursor == 3 );
- textbox_keybinding ( box, MOVE_CHAR_FORWARD);
+ textbox_keybinding ( box, MOVE_CHAR_FORWARD );
TASSERT ( box->cursor == 4 );
- textbox_keybinding ( box, MOVE_CHAR_FORWARD);
+ textbox_keybinding ( box, MOVE_CHAR_FORWARD );
TASSERT ( box->cursor == 4 );
// Cursor after delete section.
textbox_delete ( box, 0, 1 );
@@ -122,32 +122,31 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
TASSERT ( strcmp ( box->text, "aapmies" ) == 0 );
TASSERT ( box->cursor == 5 );
-
- textbox_text ( box, "aap noot mies");
+ textbox_text ( box, "aap noot mies" );
textbox_cursor ( box, 8 );
textbox_keybinding ( box, REMOVE_WORD_BACK );
- TASSERT ( box->cursor == 4);
- TASSERT ( strcmp ( box->text, "aap mies") == 0 );
+ TASSERT ( box->cursor == 4 );
+ TASSERT ( strcmp ( box->text, "aap mies" ) == 0 );
textbox_keybinding ( box, REMOVE_TO_EOL );
- TASSERT ( box->cursor == 4);
- TASSERT ( strcmp ( box->text, "aap ") == 0 );
- textbox_text ( box, "aap noot mies");
+ TASSERT ( box->cursor == 4 );
+ TASSERT ( strcmp ( box->text, "aap " ) == 0 );
+ textbox_text ( box, "aap noot mies" );
textbox_cursor ( box, 8 );
textbox_keybinding ( box, REMOVE_WORD_FORWARD );
- TASSERT ( strcmp ( box->text, "aap noot") == 0 );
+ TASSERT ( strcmp ( box->text, "aap noot" ) == 0 );
textbox_keybinding ( box, MOVE_FRONT );
- TASSERT ( box->cursor == 0);
+ TASSERT ( box->cursor == 0 );
textbox_keybinding ( box, CLEAR_LINE );
- TASSERT ( strcmp ( box->text, "") == 0 );
- textbox_text ( box, "aap noot mies");
- textbox_keybinding ( box, MOVE_END);
+ TASSERT ( strcmp ( box->text, "" ) == 0 );
+ textbox_text ( box, "aap noot mies" );
+ textbox_keybinding ( box, MOVE_END );
textbox_keybinding ( box, MOVE_WORD_BACK );
- TASSERT ( box->cursor == 9);
+ TASSERT ( box->cursor == 9 );
textbox_keybinding ( box, MOVE_WORD_BACK );
- TASSERT ( box->cursor == 4);
+ TASSERT ( box->cursor == 4 );
textbox_keybinding ( box, REMOVE_TO_SOL );
- TASSERT ( strcmp ( box->text, "noot mies") == 0 );
- TASSERT ( box->cursor == 0);
+ TASSERT ( strcmp ( box->text, "noot mies" ) == 0 );
+ TASSERT ( box->cursor == 0 );
textbox_font ( box, HIGHLIGHT );
//textbox_draw ( box, draw );