new test

[?]
Jun 12, 2022, 5:46 PM
Y2ZIPXEMMCY5GHJDDF7OMRKEQYMSDR5QTJDA7Y2SBOTHAJKHWVOAC

Dependencies

  • [2] JFFUF5AL override mouse state lookups in tests
  • [*] LXTTOB33 extract a couple of files
  • [*] 3QNOKBFM beginnings of a test harness
  • [*] 6E3HVYWF test and App helper for mouse clicks

Change contents

  • edit in text_tests.lua at line 26
    [4.93]
    [4.93]
    function test_click_with_mouse()
    io.write('\ntest_click')
    -- display two lines with cursor on one of them
    App.screen.init{width=50, height=80}
    Lines = load_array{'abc', 'def'}
    Line_width = App.screen.width
    Cursor1 = {line=2, pos=1}
    Screen_top1 = {line=1, pos=1}
    Screen_bottom1 = {}
    -- click on the other line
    local screen_left_margin = 25 -- pixels
    App.draw()
    App.run_after_mouse_click(screen_left_margin+8,Margin_top+5, '1')
    -- cursor moves
    check_eq(Cursor1.line, 1, 'F - test_click/cursor')
    end
  • edit in app.lua at line 239
    [6.755]
    [2.5185]
    function App.run_after_mouse_click(x,y, button)
    App.fake_mouse_press(x,y, button)
    App.mousepressed(x,y, button)
    App.fake_mouse_release(x,y, button)
    App.mousereleased(x,y, button)
    App.screen.contents = {}
    App.draw()
    end