From ef7fb400c9f5884d07f3e9224dba6327e32ba85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 10 Jan 2020 14:04:34 +0100 Subject: [PATCH] [escher/test] Fix and add layout_field select up down tests --- escher/test/layout_field.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/escher/test/layout_field.cpp b/escher/test/layout_field.cpp index 3228f3e97..ffacc7a2c 100644 --- a/escher/test/layout_field.cpp +++ b/escher/test/layout_field.cpp @@ -156,7 +156,7 @@ QUIZ_CASE(escher_layout_field_select_up_down) { Ion::Events::Division, Ion::Events::Four, Ion::Events::Five, Ion::Events::Six, Ion::Events::Left, Ion::Events::Left, Ion::Events::Left, Ion::Events::Left, Ion::Events::ShiftUp}; - assert_events_lead_to_selection(events, eventsCount, "123/456"); + assert_events_lead_to_selection(events, eventsCount, ""); } { // Select down next to a fraction (cursor not on the fraction) @@ -168,7 +168,27 @@ QUIZ_CASE(escher_layout_field_select_up_down) { Ion::Events::Six, Ion::Events::Left, Ion::Events::Left, Ion::Events::Left, Ion::Events::Left, Ion::Events::Left, Ion::Events::Right, Ion::Events::ShiftDown}; - assert_events_lead_to_selection(events, eventsCount, "123/456"); + assert_events_lead_to_selection(events, eventsCount, ""); + } + /* 12345 + * ----- + * ghi + * ---- + * k|lm */ + { + // Select up next to a fraction (cursor on fraction) + const int eventsCount = 17; + Ion::Events::Event events[eventsCount] = { + Ion::Events::One, Ion::Events::Two, Ion::Events::Three, + Ion::Events::Four, Ion::Events::Five, Ion::Events::Division, + Ion::Events::LowerG, Ion::Events::LowerH, Ion::Events::LowerI, + Ion::Events::Division, Ion::Events::LowerK, Ion::Events::LowerL, + Ion::Events::LowerM, Ion::Events::Left, Ion::Events::Left, + Ion::Events::ShiftUp, Ion::Events::ShiftUp + + }; + assert_events_lead_to_selection(events, eventsCount - 1, "ghi/klm"); + assert_events_lead_to_selection(events, eventsCount, "12345/\x12ghi/klm\x13"); } }