[gtksourceview/gtksourceview-5-4] testsuite: reset vim regiseters between runs
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/gtksourceview-5-4] testsuite: reset vim regiseters between runs
- Date: Sun, 12 Jun 2022 17:42:45 +0000 (UTC)
commit 34f5b43badca2362f80c81f6d23db154a9991ff0
Author: Christian Hergert <chergert redhat com>
Date: Wed May 25 13:19:12 2022 -0700
testsuite: reset vim regiseters between runs
Now that we (more correctly) have vim registers shared between GtkSourceVim
stacks, we need to reset them before each test case.
testsuite/test-vim-input.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/testsuite/test-vim-input.c b/testsuite/test-vim-input.c
index 05703ee3..f3f43213 100644
--- a/testsuite/test-vim-input.c
+++ b/testsuite/test-vim-input.c
@@ -26,6 +26,7 @@
#include <gtksourceview/vim/gtksourcevimcommand.h>
#include <gtksourceview/vim/gtksourceviminsert.h>
#include <gtksourceview/vim/gtksourcevimnormal.h>
+#include <gtksourceview/vim/gtksourcevimregisters.h>
#include <gtksourceview/vim/gtksourcevimstate.h>
static void
@@ -38,9 +39,13 @@ run_test (const char *text,
GtkSourceStyleSchemeManager *schemes = gtk_source_style_scheme_manager_get_default ();
GtkSourceStyleScheme *scheme = gtk_source_style_scheme_manager_get_scheme (schemes, "Adwaita");
GtkSourceVim *vim = gtk_source_vim_new (view);
+ GtkSourceVimState *registers = gtk_source_vim_state_get_registers (GTK_SOURCE_VIM_STATE (vim));
GtkTextIter begin, end;
char *ret;
+ /* Registers are shared per-process, so they need to be reset between runs */
+ gtk_source_vim_registers_reset (GTK_SOURCE_VIM_REGISTERS (registers));
+
gtk_source_buffer_set_style_scheme (buffer, scheme);
gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer), text, -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]