test both ways of selecting text with mouse
[?]
Jun 9, 2022, 10:09 PM
WAR3HXHTN7JZVV6TFMU2F3QYAG6NDH7DN7KKPTM2ICEHRNQYP6PACDependencies
Change contents
- edit in text_tests.lua at line 192
-- press and hold on first locationApp.run_after_mousepress(screen_left_margin+8,Margin_top+5, '1')-- drag and release somewhere elseApp.run_after_mouserelease(screen_left_margin+20,Margin_top+Line_height+5, '1')check_eq(Cursor1.line, 2, 'F - test_select_text_using_mouse/cursor:line')check_eq(Cursor1.pos, 4, 'F - test_select_text_using_mouse/cursor:pos')check_eq(Selection1.line, 1, 'F - test_select_text_using_mouse/selection:line')check_eq(Selection1.pos, 2, 'F - test_select_text_using_mouse/selection:pos')endfunction test_select_text_using_mouse_and_shift()io.write('\ntest_select_text_using_mouse_and_shift')App.screen.init{width=50, height=60}Lines = load_array{'abc', 'def', 'xyz'}Line_width = App.screen.widthCursor1 = {line=1, pos=1}Screen_top1 = {line=1, pos=1}Screen_bottom1 = {}Selection1 = {}App.draw() -- populate line.y for each line in Lineslocal screen_left_margin = 25 -- pixels - replacement in text_tests.lua at line 221
check_eq(Cursor1.line, 2, 'F - test_select_text_using_mouse/cursor:line')check_eq(Cursor1.pos, 4, 'F - test_select_text_using_mouse/cursor:pos')check_eq(Selection1.line, 1, 'F - test_select_text_using_mouse/selection:line')check_eq(Selection1.pos, 2, 'F - test_select_text_using_mouse/selection:pos')check_eq(Cursor1.line, 2, 'F - test_select_text_using_mouse_and_shift/cursor:line')check_eq(Cursor1.pos, 4, 'F - test_select_text_using_mouse_and_shift/cursor:pos')check_eq(Selection1.line, 1, 'F - test_select_text_using_mouse_and_shift/selection:line')check_eq(Selection1.pos, 2, 'F - test_select_text_using_mouse_and_shift/selection:pos')