test: autosave after name/move/delete of point

[?]
Jun 15, 2022, 5:17 AM
Y4VYNEGFA3RYG5TR75B3FTVU6DITIS3TQDCOOSYSIUG5NBFEYM6QC

Dependencies

  • [2] YW5324Q3 bugfix: cut (C-x) without first selecting anything
  • [3] KAUD3YIK tests: deleting points/shapes
  • [4] 2XLZCWZC bugfix: rectangles and squares are now saved
  • [5] CPZGQT72 go through and fix similar issues
  • [6] DSLD74DK lots more tests
  • [7] SVJZZDC3 snapshot - no, that's all wrong
  • [8] K464QQR4 more defensive resize handling
  • [9] 7CLGG7J2 test: autosave after any shape
  • [10] GHZMRR33 some more manual tests related to drawings
  • [11] BYG5CEMV support for naming points
  • [12] L6XA5EY2 test: moving a point
  • [*] K2X6G75Z start writing some tests for drawings
  • [*] 42LVB4DE test: naming a point
  • [*] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing

Change contents

  • edit in drawing_tests.lua at line 354
    [15.242]
    [15.242]
    Filename = 'foo'
  • edit in drawing_tests.lua at line 385
    [15.1770]
    [4.14]
    -- change is saved
    Lines = load_from_disk(Filename)
    local p2 = Lines[1].points[drawing.shapes[1].p2]
    check_eq(p2.name, 'A', 'F - test_name_point/save')
  • edit in drawing_tests.lua at line 394
    [4.112]
    [4.112]
    Filename = 'foo'
  • edit in drawing_tests.lua at line 413
    [4.1137]
    [4.1137]
    -- line is saved to disk
    Lines = load_from_disk(Filename)
    local drawing = Lines[1]
    local p2 = Lines[1].points[drawing.shapes[1].p2]
    check_eq(p2.x, 35, 'F - test_move_point/save/x')
    check_eq(p2.y, 36, 'F - test_move_point/save/y')
    App.draw()
  • edit in drawing_tests.lua at line 436
    [4.1938]
    [3.14]
    -- change is saved
    Lines = load_from_disk(Filename)
    local p2 = Lines[1].points[drawing.shapes[1].p2]
    check_eq(p2.x, 26, 'F - test_move_point/save/x')
    check_eq(p2.y, 44, 'F - test_move_point/save/y')
  • edit in drawing_tests.lua at line 446
    [3.158]
    [3.158]
    Filename = 'foo'
  • edit in drawing_tests.lua at line 465
    [3.1304]
    [3.1304]
    -- deleted points disappear after file is reloaded
    Lines = load_from_disk(Filename)
    check_eq(#Lines[1].shapes, 0, 'F - test_delete_lines_at_point/save')
  • edit in Manual_tests.md at line 15
    [4.3][4.3:16](),[4.131][4.60:128](),[2.146][2.146:147]()
    persistence:
    select a point and name it, quit, restart. Name is still visible.