billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=ac82934c83266b9d4b8ca0978d0f21e3b842b69f

commit ac82934c83266b9d4b8ca0978d0f21e3b842b69f
Author: Boris Faure <[email protected]>
Date:   Sun Feb 10 19:36:46 2019 +0100

    termptyext: add testing escape codes about selections
---
 src/bin/termptyext.c | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/src/bin/termptyext.c b/src/bin/termptyext.c
index 5da778d..8b29ed4 100644
--- a/src/bin/termptyext.c
+++ b/src/bin/termptyext.c
@@ -217,6 +217,23 @@ _handle_mouse_move(Termpty *ty,
    termio_internal_mouse_move(sd, &ev, modifiers);
 }
 
+static void
+_handle_selection_is(Termpty *ty,
+                     const Eina_Unicode *buf)
+{
+   Eina_Unicode *cp = ty->selection.codepoints;
+
+   assert(ty->selection.is_active);
+   assert(ty->selection.codepoints != NULL);
+
+   while (*buf)
+     {
+        assert(*buf == *cp);
+        cp++;
+        buf++;
+     }
+}
+
 /* Testing escape codes that start with '\033}t' and end with '\0'
  * Then,
  * - 'd': mouse down:
@@ -230,13 +247,19 @@ tytest_handle_escape_codes(Termpty *ty,
    switch (buf[0])
      {
       case 'd':
-        return _handle_mouse_down(ty, buf + 1);
+        _handle_mouse_down(ty, buf + 1);
         break;
       case 'm':
-        return _handle_mouse_move(ty, buf + 1);
+        _handle_mouse_move(ty, buf + 1);
+        break;
+      case 'n':
+        assert(!ty->selection.is_active);
+        break;
+      case 's':
+        _handle_selection_is(ty, buf+1);
         break;
       case 'u':
-        return _handle_mouse_up(ty, buf + 1);
+        _handle_mouse_up(ty, buf + 1);
         break;
       default:
         break;

-- 


Reply via email to