test_folders.lua
57 lines ยท 1.3 KB
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 | |
| 4 | print("Testing eHydra Folder Structure") |
| 5 | print("==============================") |
| 6 | |
| 7 | -- Test folder creation function |
| 8 | local 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 |
| 17 | end |
| 18 | |
| 19 | -- Test the folder structure |
| 20 | local testFolders = { |
| 21 | "programs", |
| 22 | "programs/eHydra", |
| 23 | "programs/stairs", |
| 24 | "programs/quarry", |
| 25 | "programs/tClear", |
| 26 | "programs/gps" |
| 27 | } |
| 28 | |
| 29 | print() |
| 30 | print("Creating test folder structure...") |
| 31 | |
| 32 | for _, folder in ipairs(testFolders) do |
| 33 | ensureDirectory(folder) |
| 34 | end |
| 35 | |
| 36 | print() |
| 37 | print("Testing file path generation...") |
| 38 | |
| 39 | -- Test file path generation |
| 40 | local 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 | |
| 47 | for _, file in ipairs(testFiles) do |
| 48 | local path = "programs/" .. file.folder .. "/" .. file.name .. file.ext |
| 49 | print("๐ Path: " .. path) |
| 50 | end |
| 51 | |
| 52 | print() |
| 53 | print("โ Folder structure test complete!") |
| 54 | print(" All folders should be created in programs/ directory") |
| 55 | |
| 56 | |
| 57 |