Merge text0

[?]
Jan 21, 2023, 6:47 AM
CZQ3NJ4NQYNXUV5GLD4RI5ISNDDWTUZIL5UA366M6WBHL6SA2EUAC

Dependencies

  • [2] TBWAE64A app is now live, can communicate with driver
  • [3] CYGNFOA5 Merge text0
  • [4] JNJ4R56X support running tests multiple times
  • [5] BC4SO6AR clean up a print
  • [6] ECBDENZ4 Merge text.love
  • [7] FS2ITYYH record a known issue
  • [8] R5QXEHUI somebody stop me
  • [9] 2JLVAYHB start decoupling editor tests from App
  • [10] GUOQRUL7 Merge lines.love
  • [11] 36Z442IV back to commit 8123959e52f without code editing
  • [12] XX7G2FFJ intermingle freehand line drawings with text
  • [13] Y2ZIPXEM new test
  • [14] YIQYNVD2 rip out the line-width slider
  • [15] 3PSFWAIL Merge lines.love
  • [16] 2WGHUWE6 self-documenting 0 Test_right_margin
  • [17] JCXL74WV bring back everything from commit a68647ae22
  • [18] GZ2OYPSH configurable colors and cursor in editor widget
  • [19] OTIBCAUJ love2d scaffold
  • [20] ZTZOO2OQ Merge lines.love
  • [21] LF7BWEG4 group all editor globals
  • [22] 2DVVKKVA flesh out Readme
  • [23] AD34IX2Z couple more tests
  • [24] VHUNJHXB Merge lines.love
  • [25] 7CLGG7J2 test: autosave after any shape
  • [26] ETXNVRPT Merge lines.love
  • [27] AVTNUQYR basic test-enabled framework
  • [28] BLWAYPKV extract a module
  • [29] BULPIBEG beginnings of a module for the text editor
  • [30] 6LJZN727 handle chords
  • [31] S4IAYCIR delete all tests once they've executed
  • [32] ZLJGZYQG select text with shift + mouseclick
  • [33] P6SYWBLB remove a duplicate test
  • [34] D2GCFTTT clean up repl functionality
  • [35] DSLD74DK lots more tests
  • [36] LNUHQOGH start passing in Editor_state explicitly
  • [37] VSJS6O4C Merge text.love
  • [38] EX43CDDI Merge text.love
  • [39] 5OVKHVY6 nice way to make on.* handlers more discoverable
  • [40] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [41] JF5L2BBS test harness now supports copy/paste
  • [42] EKKFWP4D bugfix: couple of margin-relative computations
  • [43] TVCPXAAU rename
  • [44] K2X6G75Z start writing some tests for drawings
  • [45] CE4LZV4T drop last couple of manual tests
  • [46] HOUCPP7P Merge text.love
  • [47] IFTYOERM line.y -> line_cache.starty in a few more places
  • [48] LAW2O3NW extract variable Margin_left
  • [49] LXTTOB33 extract a couple of files
  • [50] KMSL74GA support selections in the source editor
  • [51] JMUD7T3O get rid of ugly side-effects in tests
  • [52] PX7DDEMO autosave slightly less aggressively
  • [53] A4BSGS2C Merge lines.love
  • [54] KG7YVGVR Merge lines.love
  • [55] H3ECRBXF bugfix: clicking on empty lines
  • [56] 2CTN2IEF Merge lines.love
  • [57] VP5KC4XZ Merge lines.love
  • [58] JFFUF5AL override mouse state lookups in tests
  • [59] VXORMHME delete experimental REPL
  • [60] MUJTM6RE bring back a level of wrapping
  • [61] KKMFQDR4 editing source code from within the app
  • [62] HKV72RZV bugfix: save modified files in save directory
  • [63] LRDM35CE app running again
  • [64] UHB4GARJ left/right margin -> left/right coordinates
  • [65] DB7HJBHJ Merge lines.love
  • [66] D43U7GQ4 alter on-disk representation (manifest files)
  • [67] 5F54FYKI Merge lines.love
  • [68] VHQCNMAR several more modules
  • [69] OGUV4HSA remove some memory leaks from rendered fragments
  • [70] 62JEPVQ3 bugfix: backspace from start of final line
  • [71] C3GUE45I Merge text.love
  • [72] BPWFKBXT new test: dragging and dropping a file on lines.love
  • [73] 4YDBYBA4 clean up memory leak experiments
  • [74] PTDO2SOT add state arg to schedule_save
  • [75] 3QNOKBFM beginnings of a test harness
  • [76] IMEJA43L snapshot
  • [77] T4FRZSYL delete an ancient, unused file
  • [78] FCFJVYKY redundant check
  • [79] TLOAPLBJ add a license
  • [80] 73OCE2MC after much struggle, a brute-force undo
  • [81] 2L5MEZV3 experiment: new edit namespace
  • [82] V7LATJC7 bugfix: resize
  • [83] RSZD5A7G forgot to add json.lua
  • [84] JOPVPUSA editing source code from within the app
  • [85] W5H5YI6S Merge text.love
  • [86] D2IADHMW link to default love.run for comparison
  • [87] ORRSP7FV deduce test names on failures
  • [88] OL7ZCZWD Merge text.love
  • [89] CNCYMM6A make test initializations a little more obvious
  • [90] ILOA5BYF separate data structure for each line's cache data
  • [91] MD3W5IRA new fork: rip out drawing support
  • [92] 66X36NZN a little more prose describing manual_tests
  • [93] H3KWPK3G regression: dropping files on the window
  • [94] GDAWPFAV more streamlined test names
  • [95] ORKN6EOB Merge lines.love
  • [96] YT5P6TO6 bugfix: save previous file when dropping a new one on
  • [97] UTDSCN3G Merge lines.love

Change contents

  • file deletion: run_tests.lua (----------)main_tests.lua (----------)run_tests.lua (----------)run_tests.lua (----------)
    [7.2][7.178068:178105](),[7.2][7.1125:1163](),[7.1163][7.7:7](),[7.2][7.178005:178042](),[7.178042][7.7:7](),[7.2][7.178068:178105](),[7.178105][7.7:7]()
    check_eq(App.filesystem['foo'], 'abc\ndef\n', 'check')
    end
    check_eq(#Editor_state.lines, 3, '#lines')
    check_eq(Editor_state.lines[1].data, 'abc', 'lines:1')
    check_eq(Editor_state.lines[2].data, 'def', 'lines:2')
    check_eq(Editor_state.lines[3].data, 'ghi', 'lines:3')
    edit.draw(Editor_state)
    check_eq(App.screen.width, 200, 'width')
    check_eq(App.screen.height, 400, 'height')
    check_eq(Editor_state.left, Margin_left, 'left_margin')
    check_eq(Editor_state.right, 200-Margin_right, 'right_margin')
    check_eq(Editor_state.width, 200-Margin_left-Margin_right, 'drawing_width')
    -- TODO: how to make assertions about when App.update got past the early exit?
    end
    check_eq(App.screen.width, 300, 'baseline/width')
    check_eq(App.screen.height, 300, 'baseline/height')
    check_eq(Editor_state.left, Test_margin_left, 'baseline/left_margin')
    check_eq(Editor_state.right, 300 - Test_margin_right, 'baseline/left_margin')
    -- ugly; resize switches to real, non-test margins
    check_eq(App.screen.width, 200, 'width')
    check_eq(App.screen.height, 400, 'height')
    check_eq(Editor_state.left, Margin_left, 'left_margin')
    check_eq(Editor_state.right, 200-Margin_right, 'right_margin')
    check_eq(Editor_state.width, 200-Margin_left-Margin_right, 'drawing_width')
    App.resize(200, 400)
  • resurrect zombie in text_tests.lua at line 8
    [7.347][7.2:40](),[7.347][7.2:40]()
    edit.draw(Editor_state, Text_color)
  • resurrect zombie in text_tests.lua at line 9
    [7.28][7.2:283](),[7.28][7.2:283]()
    check_eq(#Editor_state.lines, 1, '#lines')
    check_eq(Editor_state.cursor1.line, 1, 'cursor:line')
    check_eq(Editor_state.cursor1.pos, 1, 'cursor:pos')
    check_eq(Editor_state.screen_top1.line, 1, 'screen_top:line')
    check_eq(Editor_state.screen_top1.pos, 1, 'screen_top:pos')
  • resolve order conflict in text_tests.lua at line 9
    [7.40]
    [7.2]
  • edit in text_tests.lua at line 231
    [7.7400][3.4:33](),[3.33][7.665:703](),[7.329][7.665:703](),[7.703][3.35:35](),[3.35][3.36:345]()
    -- click on the other line
    edit.draw(Editor_state, Text_color)
    edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)
    -- cursor moves
    check_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse/cursor:line')
    check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse/selection is empty to avoid perturbing future edits')
  • resurrect zombie in text_tests.lua at line 231
    [7.354][7.1633:1743](),[7.354][7.1633:1743](),[7.492][7.1744:1862](),[7.492][7.1744:1862]()
    check_eq(Editor_state.cursor1.line, 1, 'cursor:line')
    check_eq(Editor_state.cursor1.pos, 2, 'cursor:pos')
    check_nil(Editor_state.selection1.line, 'selection:line')
    check_nil(Editor_state.selection1.pos, 'selection:pos')
  • edit in text_tests.lua at line 231
    [7.7400]
    [7.1633]
    Editor_state.selection1 = {}
    edit.draw(Editor_state, Text_color) -- 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)
  • edit in text_tests.lua at line 236
    [7.1743]
    [7.1744]
    -- selection is empty to avoid perturbing future edits
  • edit in text_tests.lua at line 783
    [7.6666][7.5647:5652](),[7.5647][7.5647:5652](),[7.5652][3.348:757](),[3.757][7.1718:1825](),[7.19386][7.1718:1825](),[7.1825][3.758:1206]()
    end
    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, Text_color) -- 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')
  • edit in app.lua at line 3
    [7.1772][2.667:798]()
    -- Most apps can just use the default (https://love2d.org/wiki/love.run), but
    -- we need to override it to install a test harness.
  • edit in app.lua at line 434
    [7.47][4.2001:2064]()
    local status, err = xpcall(_G[name], handle_error_in_test)
  • resurrect zombie in app.lua at line 436
    [7.7564][4.2065:2083](),[7.7564][4.2065:2083]()
    App = saved_app
  • edit in app.lua at line 439
    [7.7569][4.2084:2260]()
    function handle_error_in_test(err)
    local full_error = debug.traceback('Error: '..err, --[[stack frame]]3):gsub('\n[^\n]+$', '')
    table.insert(Test_errors, full_error..'\n')
  • resurrect zombie in app.lua at line 439
    [7.7569][7.60753:61192](),[7.7569][7.60753:61192]()
    -- prepend file/line/test
    function prepend_debug_info_to_test_failure(test_name, err)
    local err_without_line_number = err:gsub('^[^:]*:[^:]*: ', '')
    local stack_trace = debug.traceback('', --[[stack frame]]5)
    local file_and_line_number = stack_trace:gsub('stack traceback:\n', ''):gsub(': .*', '')
    local full_error = file_and_line_number..':'..test_name..' -- '..err_without_line_number
    table.insert(Test_errors, full_error)
    end
  • edit in app.lua at line 447
    [7.61192][7.61192:61193](),[7.61192][7.61192:61193](),[4.2260][7.8162:8166](),[7.2306][7.8162:8166](),[7.2791][7.8162:8166](),[7.3061][7.8162:8166](),[7.5677][7.8162:8166](),[7.8162][7.8162:8166]()
    end