remove a duplicate test

[?]
Dec 13, 2022, 5:05 PM
P6SYWBLBN2KAYQ6VJBPYZQNCD2WQHOZGC6XOKWW4SLAMFFGH3ZYQC

Dependencies

  • [2] VSBSWTE4 bugfix: where cursor is drawn
  • [3] IFTYOERM line.y -> line_cache.starty in a few more places
  • [4] APYPFFS3 call edit rather than App callbacks in tests
  • [5] ILOA5BYF separate data structure for each line's cache data
  • [6] EKKFWP4D bugfix: couple of margin-relative computations
  • [7] DRFE3B3Z mouse buttons are integers, not strings
  • [8] Y2ZIPXEM new test
  • [9] 7NQCCB34 .
  • [10] LNUHQOGH start passing in Editor_state explicitly
  • [11] 356GY7IQ unify two similar functions
  • [12] 5DOTWNVM right margin
  • [13] 2JLVAYHB start decoupling editor tests from App
  • [14] LAW2O3NW extract variable Margin_left
  • [15] H3ECRBXF bugfix: clicking on empty lines
  • [16] LF7BWEG4 group all editor globals
  • [17] WAR3HXHT test both ways of selecting text with mouse
  • [18] ZLJGZYQG select text with shift + mouseclick
  • [19] CNCYMM6A make test initializations a little more obvious
  • [20] UHB4GARJ left/right margin -> left/right coordinates
  • [21] LXTTOB33 extract a couple of files
  • [22] HPVT467W initialize contains test state

Change contents

  • replacement in text_tests.lua at line 272
    [4.40][4.62:151](),[4.62][4.62:151]()
    -- display two lines with cursor on one of them
    App.screen.init{width=50, height=80}
    [4.40]
    [4.942]
    App.screen.init{width=50, height=60}
  • replacement in text_tests.lua at line 274
    [4.988][4.7145:7193](),[4.2305][4.7145:7193](),[4.151][4.7145:7193]()
    Editor_state.lines = load_array{'abc', 'def'}
    [4.988]
    [4.975]
    Editor_state.lines = load_array{'abc', 'def', 'xyz'}
  • replacement in text_tests.lua at line 276
    [4.1007][4.7279:7320](),[4.7279][4.7279:7320]()
    Editor_state.cursor1 = {line=2, pos=1}
    [4.1007]
    [4.7320]
    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 line
    edit.draw(Editor_state)
    edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
    -- cursor moves
    [4.7400]
    [4.2]
    Editor_state.selection1 = {}
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    edit.run_after_mouse_release(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
  • replacement in text_tests.lua at line 283
    [4.164][4.7564:7687](),[4.7564][4.7564:7687]()
    check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse/selection is empty to avoid perturbing future edits')
    [4.84]
    [4.2]
    check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse/cursor:pos')
    -- selection is empty to avoid perturbing future edits
    check_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_cache
    edit.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