remove a duplicate test
[?]
Dec 13, 2022, 5:05 PM
P6SYWBLBN2KAYQ6VJBPYZQNCD2WQHOZGC6XOKWW4SLAMFFGH3ZYQCDependencies
- [2]
VSBSWTE4bugfix: where cursor is drawn - [3]
IFTYOERMline.y -> line_cache.starty in a few more places - [4]
APYPFFS3call edit rather than App callbacks in tests - [5]
ILOA5BYFseparate data structure for each line's cache data - [6]
EKKFWP4Dbugfix: couple of margin-relative computations - [7]
DRFE3B3Zmouse buttons are integers, not strings - [8]
Y2ZIPXEMnew test - [9]
7NQCCB34. - [10]
LNUHQOGHstart passing in Editor_state explicitly - [11]
356GY7IQunify two similar functions - [12]
5DOTWNVMright margin - [13]
2JLVAYHBstart decoupling editor tests from App - [14]
LAW2O3NWextract variable Margin_left - [15]
H3ECRBXFbugfix: clicking on empty lines - [16]
LF7BWEG4group all editor globals - [17]
WAR3HXHTtest both ways of selecting text with mouse - [18]
ZLJGZYQGselect text with shift + mouseclick - [19]
CNCYMM6Amake test initializations a little more obvious - [20]
UHB4GARJleft/right margin -> left/right coordinates - [21]
LXTTOB33extract a couple of files - [22]
HPVT467Winitialize contains test state
Change contents
- replacement in text_tests.lua at line 272
-- display two lines with cursor on one of themApp.screen.init{width=50, height=80}App.screen.init{width=50, height=60} - replacement in text_tests.lua at line 274
Editor_state.lines = load_array{'abc', 'def'}Editor_state.lines = load_array{'abc', 'def', 'xyz'} - replacement in text_tests.lua at line 276
Editor_state.cursor1 = {line=2, pos=1}Editor_state.cursor1 = {line=1, pos=1} - replacement in text_tests.lua at line 279[4.7400]→[4.300:329](∅→∅),[4.300]→[4.300:329](∅→∅),[4.329]→[4.529:555](∅→∅),[4.555]→[4.2306:2392](∅→∅),[4.61]→[4.453:471](∅→∅),[4.68]→[4.453:471](∅→∅),[4.1091]→[4.453:471](∅→∅),[4.2392]→[4.453:471](∅→∅),[4.7486]→[4.453:471](∅→∅),[4.453]→[4.453:471](∅→∅)
-- click on the other lineedit.draw(Editor_state)edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)-- cursor movesEditor_state.selection1 = {}edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cacheedit.run_after_mouse_release(Editor_state, Editor_state.left+8,Editor_state.top+5, 1) - replacement in text_tests.lua at line 283
check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse/selection is empty to avoid perturbing future edits')check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse/cursor:pos')-- selection is empty to avoid perturbing future editscheck_nil(Editor_state.selection1.line, 'F - test_click_with_mouse/selection:line')check_nil(Editor_state.selection1.pos, 'F - test_click_with_mouse/selection:pos') - edit in text_tests.lua at line 860[4.5652]→[4.5652:5776](∅→∅),[4.5776]→[4.2070:2116](∅→∅),[4.2116]→[4.19093:19148](∅→∅),[4.5638]→[4.19093:19148](∅→∅),[4.5776]→[4.19093:19148](∅→∅),[4.19148]→[4.2085:2117](∅→∅),[4.2117]→[4.19234:19386](∅→∅),[4.19234]→[4.19234:19386](∅→∅),[4.19386]→[3.241:336](∅→∅),[3.336]→[4.5639:5727](∅→∅),[4.1232]→[4.5639:5727](∅→∅),[4.2332]→[4.19543:19632](∅→∅),[4.5727]→[4.19543:19632](∅→∅),[4.19543]→[4.19543:19632](∅→∅),[4.19632]→[2.333:420](∅→∅),[4.420]→[4.19719:19903](∅→∅),[2.420]→[4.19719:19903](∅→∅),[4.19719]→[4.19719:19903](∅→∅),[4.19903]→[4.179:184](∅→∅),[4.179]→[4.179:184](∅→∅)
function test_move_cursor_using_mouse()io.write('\ntest_move_cursor_using_mouse')App.screen.init{width=50, height=60}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc', 'def', 'xyz'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=1, pos=1}Editor_state.screen_top1 = {line=1, pos=1}Editor_state.screen_bottom1 = {}Editor_state.selection1 = {}edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cacheedit.run_after_mouse_release(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)check_eq(Editor_state.cursor1.line, 1, 'F - test_move_cursor_using_mouse/cursor:line')check_eq(Editor_state.cursor1.pos, 2, 'F - test_move_cursor_using_mouse/cursor:pos')check_nil(Editor_state.selection1.line, 'F - test_move_cursor_using_mouse/selection:line')check_nil(Editor_state.selection1.pos, 'F - test_move_cursor_using_mouse/selection:pos')end