mirror of
https://github.com/libretro/libretro-chailove.git
synced 2024-11-23 16:09:59 +00:00
Add filesystem methods
This commit is contained in:
parent
526d6aec60
commit
5aa1b09e45
@ -311,6 +311,9 @@ script::script(const std::string& file) {
|
||||
chai.add(fun<std::vector<std::string>, filesystem, const std::string&, const std::string&>(&filesystem::lines), "lines");
|
||||
chai.add(fun(&filesystem::load), "load");
|
||||
chai.add(fun(&script::loadModuleRequire, this), "require");
|
||||
chai.add(fun(&filesystem::getFileExtension), "getFileExtension");
|
||||
chai.add(fun(&filesystem::getBasename), "getBasename");
|
||||
chai.add(fun(&filesystem::getParentDirectory), "getParentDirectory");
|
||||
|
||||
// System
|
||||
chai.add(fun(&system::getOS), "getOS");
|
||||
|
@ -102,3 +102,12 @@ requiretestFileLoaded = false
|
||||
requireReturn = require("assets.requiretest")
|
||||
assert(requireReturn, " double call")
|
||||
assert_not(requiretestFileLoaded, " not loaded twice")
|
||||
|
||||
// getFileExtension()
|
||||
assert_equal(love.filesystem.getFileExtension("/opt/var/something.txt"), "txt", "love.filesystem.getFileExtension()")
|
||||
|
||||
// getBasename
|
||||
assert_equal(love.filesystem.getBasename("/opt/var/something.txt"), "something.txt", "love.filesystem.getBasename()")
|
||||
|
||||
// getParentDirectory
|
||||
assert_equal(love.filesystem.getParentDirectory("/opt/var/something.txt"), "/opt/var", "love.filesystem.getParentDirectory()")
|
||||
|
Loading…
Reference in New Issue
Block a user