about summary refs log tree commit diff stats
path: root/drawing_tests.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-25 19:56:39 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-25 19:56:39 -0700
commit48162b981689c58e54ad44f45a9ba4b70a1c68d7 (patch)
tree8184b384917184e1553017b278602f9515d49f18 /drawing_tests.lua
parente26470aada335d56c0766fb2e32524981a6e9af2 (diff)
downloadtext.love-48162b981689c58e54ad44f45a9ba4b70a1c68d7.tar.gz
have file API operate on state object
Diffstat (limited to 'drawing_tests.lua')
-rw-r--r--drawing_tests.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/drawing_tests.lua b/drawing_tests.lua
index 5301318..f1e39a6 100644
--- a/drawing_tests.lua
+++ b/drawing_tests.lua
@@ -55,7 +55,7 @@ function test_draw_line()
   edit.update(Editor_state, 0)
   -- The format on disk isn't perfectly stable. Table fields can be reordered.
   -- So just reload from disk to verify.
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   local drawing = Editor_state.lines[1]
   check_eq(#drawing.shapes, 1, 'F - test_draw_line/save/#shapes')
@@ -433,7 +433,7 @@ function test_name_point()
   App.wait_fake_time(3.1)
   edit.update(Editor_state, 0)
   -- change is saved
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   local p2 = Editor_state.lines[1].points[drawing.shapes[1].p2]
   check_eq(p2.name, 'A', 'F - test_name_point/save')
@@ -465,7 +465,7 @@ function test_move_point()
   App.wait_fake_time(3.1)
   edit.update(Editor_state, 0)
   -- line is saved to disk
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   local drawing = Editor_state.lines[1]
   local p2 = Editor_state.lines[1].points[drawing.shapes[1].p2]
@@ -492,7 +492,7 @@ function test_move_point()
   App.wait_fake_time(3.1)
   edit.update(Editor_state, 0)
   -- change is saved
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   local p2 = Editor_state.lines[1].points[drawing.shapes[1].p2]
   check_eq(p2.x, 26, 'F - test_move_point/save/x')
@@ -553,7 +553,7 @@ function test_delete_lines_at_point()
   App.wait_fake_time(3.1)
   edit.update(Editor_state, 0)
   -- deleted points disappear after file is reloaded
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_delete_lines_at_point/save')
 end
@@ -687,7 +687,7 @@ function test_undo_name_point()
   App.wait_fake_time(3.1)
   edit.update(Editor_state, 0)
   -- undo is saved
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   local p2 = Editor_state.lines[1].points[drawing.shapes[1].p2]
   check_eq(p2.name, '', 'F - test_undo_name_point/save')
@@ -738,7 +738,7 @@ function test_undo_move_point()
   App.wait_fake_time(3.1)
   edit.update(Editor_state, 0)
   -- undo is saved
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   local p2 = Editor_state.lines[1].points[drawing.shapes[1].p2]
   check_eq(p2.x, 35, 'F - test_undo_move_point/save/x')
@@ -779,7 +779,7 @@ function test_undo_delete_point()
   App.wait_fake_time(3.1)
   edit.update(Editor_state, 0)
   -- undo is saved
-  Editor_state.lines = load_from_disk(Editor_state.filename)
+  load_from_disk(Editor_state)
   Text.redraw_all(Editor_state)
   check_eq(#Editor_state.lines[1].shapes, 2, 'F - test_undo_delete_point/save')
 end