[gtksourceview/wip/chergert/vim] split up tests



commit 42f1c6c9414003d05eae8f7154e9dbaa21804345
Author: Christian Hergert <chergert redhat com>
Date:   Mon Nov 8 18:51:57 2021 -0800

    split up tests

 testsuite/test-vim-input.c | 40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)
---
diff --git a/testsuite/test-vim-input.c b/testsuite/test-vim-input.c
index 0c935119..f01791b3 100644
--- a/testsuite/test-vim-input.c
+++ b/testsuite/test-vim-input.c
@@ -91,25 +91,42 @@ run_test (const char *text,
 }
 
 static void
-test_motion (void)
+test_yank (void)
 {
-       run_test ("a word here.", "v$x", "");
-       run_test ("a word here.", "vex", " here.");
-       run_test ("line1", "o\e", "line1\n");
-       run_test ("line1", "O\e", "\nline1");
        run_test ("1\n2\n3", "yGP", "1\n2\n3\n1\n2\n3");
        run_test ("1\n2\n3", "yGp", "1\n1\n2\n3\n2\n3");
+       run_test ("1\n2\n3", "\"zyGP", "1\n2\n3");
+       run_test ("1\n2\n3", "\"zyG\"zP", "1\n2\n3\n1\n2\n3");
+}
+
+static void
+test_insert (void)
+{
+       run_test ("line1", "o\e", "line1\n");
+       run_test ("line1", "O\e", "\nline1");
+       run_test ("", "itesting\ea this.\e", "testing this.");
+       run_test ("", "3iz\e", "zzz");
+}
+
+static void
+test_change (void)
+{
+       run_test ("word here", "ciwnot\e", "not here");
+}
+
+static void
+test_delete (void)
+{
+       run_test ("a word here.", "v$x", "");
+       run_test ("a word here.", "vex", " here.");
        run_test ("line1", "dd", "");
        run_test ("line1\n", "dj", "");
        run_test ("line1\n\n", "dj", "");
        run_test ("1\n2\n", "d2j", "");
        run_test ("1\n2\n", "d10j", "");
-       run_test ("", "itesting\ea this.\e", "testing this.");
-       run_test ("", "3iz\e", "zzz");
-       run_test ("word here", "ciwnot\e", "not here");
-       run_test ("1\n2\n3\n4", "dG", "");
        run_test ("1\n2\n3\n42", "vjjjx", "2");
        run_test ("1\n2\n3\n42", "vjjjVx", "");
+       run_test ("1\n2\n3\n4", "dG", "");
        run_test ("1\n2\n3\n42", "jmzjjd'z", "1\n");
        run_test ("1\n2\n3\n4\n5", "4Gd1G", "5");
        run_test ("1\n2\n3\n4\n5", ":4\nd1G", "5");
@@ -185,7 +202,10 @@ main (int argc,
        gtk_init ();
        gtk_source_init ();
        g_test_init (&argc, &argv, NULL);
-       g_test_add_func ("/GtkSourceView/vim-input/motion", test_motion);
+       g_test_add_func ("/GtkSourceView/vim-input/yank", test_yank);
+       g_test_add_func ("/GtkSourceView/vim-input/insert", test_insert);
+       g_test_add_func ("/GtkSourceView/vim-input/change", test_change);
+       g_test_add_func ("/GtkSourceView/vim-input/delete", test_delete);
        g_test_add_func ("/GtkSourceView/vim-input/search-and-replace", test_search_and_replace);
        ret = g_test_run ();
        gtk_source_finalize ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]