From b8854d34062a8786ae47306908d09c49db2835f4 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 13 Jun 2022 19:17:05 -0300 Subject: [PATCH] Add simple tests for SaveFile-commands --- scripts/save_file_command.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/save_file_command.lua diff --git a/scripts/save_file_command.lua b/scripts/save_file_command.lua new file mode 100644 index 000000000..a8b50efb8 --- /dev/null +++ b/scripts/save_file_command.lua @@ -0,0 +1,17 @@ +-- Copyright (C) 2022 Igara Studio S.A. +-- +-- This file is released under the terms of the MIT license. +-- Read LICENSE.txt for more information. + +do + local spr = Sprite(32, 32) + spr.filename = "_test_a.png" + app.command.SaveFile() + assert(spr.filename == "_test_a.png") + + app.command.SaveFileAs{ filename="_test_b.png" } + assert(spr.filename == "_test_b.png") + + app.command.SaveFileCopyAs{ filename="_test_c.png" } + assert(spr.filename == "_test_b.png") +end