]> git.mdlowis.com Git - projs/tide.git/commitdiff
added tests for change focus and normal input
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 7 Dec 2016 21:28:02 +0000 (16:28 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 7 Dec 2016 21:28:02 +0000 (16:28 -0500)
tests/xedit.c

index 89673c38fbe26e29bd79e6d27ba7e9a843e4f12b..068f13f07316aff6c594c677213c7fabcbe70917 100644 (file)
@@ -373,4 +373,27 @@ TEST_SUITE(XeditTests) {
         CHECK(getsel(EDIT)->beg == 2);
         CHECK(getsel(EDIT)->end == 2);
     }
+    
+    /* Key Handling - Normal Input
+     *************************************************************************/
+    TEST(input not matching a shortcut should be inserted as text) {
+        setup_view(EDIT, "", 0);
+        send_keys(ModNone, 'e');
+        CHECK(getsel(EDIT)->beg == 1);
+        CHECK(getsel(EDIT)->end == 1);
+    }
+    
+    /* Key Handling - Implementation Specific
+     *************************************************************************/
+    TEST(ctrl+t should switch focus to EDIT view) {
+        Focused = TAGS;
+        send_keys(ModCtrl, 't');
+        CHECK(Focused == EDIT);
+    }
+    
+    TEST(ctrl+t should switch focus to TAGs view) {
+        Focused = EDIT;
+        send_keys(ModCtrl, 't');
+        CHECK(Focused == TAGS);
+    }
 }