From f8a41a8cb413288a66a389137d3f40afbd8effd6 Mon Sep 17 00:00:00 2001 From: eleksir Date: Mon, 27 Oct 2025 17:29:18 +0300 Subject: [PATCH] Rename test data files according to test numbers --- cmd/01-LoadJsonFile/main.go | 6 +++--- cmd/02-TestLuaScript/main.go | 6 ++++-- test_data/{config.json => 01-config.json} | 0 test_data/{01-test.lua => 02-test.lua} | 0 4 files changed, 7 insertions(+), 5 deletions(-) rename test_data/{config.json => 01-config.json} (100%) rename test_data/{01-test.lua => 02-test.lua} (100%) diff --git a/cmd/01-LoadJsonFile/main.go b/cmd/01-LoadJsonFile/main.go index 2c34340..bded6d7 100644 --- a/cmd/01-LoadJsonFile/main.go +++ b/cmd/01-LoadJsonFile/main.go @@ -10,11 +10,11 @@ import ( func main() { log.Init("info", os.Stderr) - log.Info("loading config.json") + log.Info("loading 01-config.json") - data := doll.LoadJsonFile("test_data/config.json") + data := doll.LoadJsonFile("test_data/01-config.json") - log.Info("data fron config.json is") + log.Info("data from 01-config.json is") spew.Dump(data) } diff --git a/cmd/02-TestLuaScript/main.go b/cmd/02-TestLuaScript/main.go index a1c40c5..22b671e 100644 --- a/cmd/02-TestLuaScript/main.go +++ b/cmd/02-TestLuaScript/main.go @@ -14,9 +14,11 @@ func main() { defer L.Close() // Load the Lua script file. - log.Info("Loading ./test_data/01-test.lua") + log.Info("Loading ./test_data/02-test.lua") - luaCode, err := os.ReadFile("./test_data/01-test.lua") + // We can execute script directly via L.DoFile("./test_data/02-test.lua") but in practice we'll get scripts as + // strings - snippets from templates - so, testing/checking how it works is not use for project. + luaCode, err := os.ReadFile("./test_data/02-test.lua") if err != nil { log.Errorf("Error reading Lua file: %s", err) diff --git a/test_data/config.json b/test_data/01-config.json similarity index 100% rename from test_data/config.json rename to test_data/01-config.json diff --git a/test_data/01-test.lua b/test_data/02-test.lua similarity index 100% rename from test_data/01-test.lua rename to test_data/02-test.lua