From 65a1158e40b30d8c06d6398bc142c6ae9e783006 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 10 Apr 2015 21:40:45 +0200 Subject: Added proper implementation of cFile::ChangeFileExt(). --- MCServer/Plugins/Debuggers/Debuggers.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index d0c362ab4..c8e96d378 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -62,6 +62,7 @@ function Initialize(Plugin) TestStringBase64() -- TestUUIDFromName() -- TestRankMgr() + TestFileExt() --[[ -- Test cCompositeChat usage in console-logging: @@ -79,6 +80,18 @@ end; +function TestFileExt() + assert(cFile:ChangeFileExt("fileless_dir/", "new") == "fileless_dir/") + assert(cFile:ChangeFileExt("pathless_file.ext", "new") == "pathless_file.new") + assert(cFile:ChangeFileExt("path/to/file.ext", "new") == "path/to/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file", "new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file.ext", "new") == "path/to.dir/file.new") +end + + + + + function TestPluginCalls() -- In order to test the inter-plugin communication, we're going to call Core's ReturnColorFromChar() function -- It is a rather simple function that doesn't need any tables as its params and returns a value, too -- cgit v1.2.3