[gnome-builder] tests: handle shift in keypress
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] tests: handle shift in keypress
- Date: Thu, 23 Apr 2015 00:11:46 +0000 (UTC)
commit 17d4e2d1aa54cac0cf35745c0a1cab07bb3fa3a2
Author: Christian Hergert <christian hergert me>
Date: Wed Apr 22 17:11:34 2015 -0700
tests: handle shift in keypress
tests/test-ide-indenter.c | 2 ++
tests/test-vim.c | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tests/test-ide-indenter.c b/tests/test-ide-indenter.c
index 0c6c0fd..b089805 100644
--- a/tests/test-ide-indenter.c
+++ b/tests/test-ide-indenter.c
@@ -159,6 +159,8 @@ synthesize_event (GtkTextView *text_view,
ev->key.keyval = gdk_unicode_to_keyval (ch);
ev->key.length = strlen (str);
ev->key.string = g_strdup (str);
+ if (g_unichar_isupper (ch))
+ ev->key.state |= GDK_SHIFT_MASK;
break;
}
diff --git a/tests/test-vim.c b/tests/test-vim.c
index e50cd48..282f1e7 100644
--- a/tests/test-vim.c
+++ b/tests/test-vim.c
@@ -161,6 +161,8 @@ synthesize_event (GtkTextView *text_view,
ev->key.keyval = gdk_unicode_to_keyval (ch);
ev->key.length = strlen (str);
ev->key.string = g_strdup (str);
+ if (g_unichar_isupper (ch))
+ ev->key.state |= GDK_SHIFT_MASK;
break;
}
@@ -235,6 +237,7 @@ test_vim_basic_cb (IdeContext *context,
NULL);
assert_keypress_equal (widget, "ithis is a test.\e", "this is a test.");
+ assert_keypress_equal (widget, "ithis is a test.\eI\e4x", " is a test.");
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]