Mercurial > games > semicongine
diff tests/test_resources.nim @ 1139:114f395b9144
did: finish refactoring and updated all tests accordingly
author | sam <sam@basx.dev> |
---|---|
date | Sat, 08 Jun 2024 14:58:25 +0700 |
parents | 1ab09f8cc68d |
children |
line wrap: on
line diff
--- a/tests/test_resources.nim Tue Jun 04 22:08:48 2024 +0700 +++ b/tests/test_resources.nim Sat Jun 08 14:58:25 2024 +0700 @@ -6,27 +6,27 @@ import semicongine proc list_all_mods_all_files() = - for package in packages(): + for package in Packages(): echo &"Files in package {package}:" - for i in walkResources(package = package): - echo " ", i, ": ", i.loadResource(package = package).readAll().len + for i in WalkResources(package = package): + echo " ", i, ": ", i.LoadResource(package = package).readAll().len proc print_ls(dir, package: string, indent = 2) = - for i in dir.ls(package = package): + for i in dir.List(package = package): if i.kind == pcDir: echo "".align(indent), i.path, "/" print_ls(dir.joinPath(i.path), package = package, indent = indent + 2) else: - echo "".align(indent), i.path, ": ", dir.joinPath(i.path).loadResource(package = package).readAll().len + echo "".align(indent), i.path, ": ", dir.joinPath(i.path).LoadResource(package = package).readAll().len proc list_files() = - for package in packages(): + for package in Packages(): echo &"Recursive walk of package {package}: " print_ls("", package = package) proc main() = - echo "Packages available: ", packages() + echo "Packages available: ", Packages() list_all_mods_all_files() list_files()