Up to Main Index Up to Journal for November, 2016 JOURNAL FOR MONDAY 14TH NOVEMBER, 2016 ______________________________________________________________________________ SUBJECT: Text and buffer updates are out DATE: Mon 14 Nov 23:16:05 GMT 2016 Testing buffers is proving to be a bit of a challenge. In order to test buffers properly I need to be able to setup a simple test world with some players in it. What I have ended up doing is creating a new package called test which has some helpers for setting up a tiny hardcoded world. Hopefully I can keep this package simple and testable while expanding it to accommodate additional testing scenarios. Also to help with testing the server executable now recognises a configuration file of NONE. Using NONE on the command line tells the server not to load any configuration or zone files. Instead it will use the built in default configuration and create the single location "The Void"[1]. Why? The config package uses an init function to load and setup configuration values. Doing so means that any other package that includes the config package can use the configuration values immediately. Even if they are also using an init function. This works because init is called during package initialisation and so other dependant packages will not see the config package until the init function returns - after loading the configuration files. However for testing you do not want everything loaded. You just need a simple, consistent setup. Specifying NONE and hardcoding a tiny world gives you this. One drawback of using NONE is that the server has no idea of where it's data directory is[2]. You can't log in to a server running with NONE as it cannot load or create player files[3]. In the meantime, while I'm sorting out all this testing, I'm going to push out the text and buffer changes to the dev branch. Mainly because people keep asking me for the new code and because it's going to take a while longer to finish testing buffers than I thought it would. PS: The tests for Fold in the text package are terribly written and I need to review my style of testing :( At least I seem to be learning from testing the buffers! Maybe I need to read "The Art of Software Testing" again as well[4]. -- Diddymus [1] If you interested see the createVoid function in the zones package. [2] Actually this is a small white lie and there is a loophole to get around this issue. However I'm not sure if I will close this loophole or make it an official feature yet. So I'm keep quiet for now. [3] I may fix this as it could be a handy feature when troubleshooting. [4] One of the most expensive & slimmest books in my collection - hardback, 1979 1st edition. When purchased it was nearly as much as a 4 volume set of "The Art of Computer Programming"! Up to Main Index Up to Journal for November, 2016