mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Tests: Modularize unit testing
Split unit tests into separate files under src/unittest/ Give better unittest diagnostics Clean up some code
This commit is contained in:
@@ -662,6 +662,12 @@ std::string RemoveRelativePathComponents(std::string path)
|
||||
return path.substr(0, pos);
|
||||
}
|
||||
|
||||
const char *GetFilenameFromPath(const char *path)
|
||||
{
|
||||
const char *filename = strrchr(path, DIR_DELIM_CHAR);
|
||||
return filename ? filename + 1 : path;
|
||||
}
|
||||
|
||||
bool safeWriteToFile(const std::string &path, const std::string &content)
|
||||
{
|
||||
std::string tmp_file = path + ".~mt";
|
||||
|
Reference in New Issue
Block a user