test_folders.lua

57 lines ยท 1.3 KB

Open raw

Test script to verify folder structure creation

Copy & run

wget https://perlytiara.github.io/turtles.tips/raw/programs/perlytiara/eHydra_wip/test_folders.lua
1-- Test script to verify folder structure creation
2-- This script tests the folder creation logic
3
4print("Testing eHydra Folder Structure")
5print("==============================")
6
7-- Test folder creation function
8local function ensureDirectory(path)
9 if not fs.exists(path) then
10 fs.makeDir(path)
11 print("โœ… Created: " .. path)
12 return true
13 else
14 print("๐Ÿ“ Exists: " .. path)
15 return false
16 end
17end
18
19-- Test the folder structure
20local testFolders = {
21 "programs",
22 "programs/eHydra",
23 "programs/stairs",
24 "programs/quarry",
25 "programs/tClear",
26 "programs/gps"
27}
28
29print()
30print("Creating test folder structure...")
31
32for _, folder in ipairs(testFolders) do
33 ensureDirectory(folder)
34end
35
36print()
37print("Testing file path generation...")
38
39-- Test file path generation
40local testFiles = {
41 {folder = "eHydra", name = "startup", ext = ".lua"},
42 {folder = "eHydra", name = "README", ext = ".md"},
43 {folder = "quarry", name = "quarry", ext = ".lua"},
44 {folder = "stairs", name = "multi", ext = ".lua"}
45}
46
47for _, file in ipairs(testFiles) do
48 local path = "programs/" .. file.folder .. "/" .. file.name .. file.ext
49 print("๐Ÿ“„ Path: " .. path)
50end
51
52print()
53print("โœ… Folder structure test complete!")
54print(" All folders should be created in programs/ directory")
55
56
57