As the current maintainer of mudlet-lua, I'm going to be adding unit test functionality to our Lua suite of scripts (eventually to the C functions as well).
The two prominent contenders for Unit Testing in Lua land are lunit and busted. lunit development has been stopped by its original author, but it has no dependencies. busted on the other hand is new, has a fair bit of unit testing features, and was created because lunit development is mostly dead. busted also integrates with travis, something that runs your tests for you when you do a commit, and I imagine notifies you about it as well.
On light of all this research, I'll be going with busted for creating tests. First tests will soon appear in my github repo, https://github.com/vadi2/mudlet-lua. If you'd like to contribute to creating tests (there are very many that need to be made), feel free to fork the repo.
Unit testing for mudlet-lua
Re: Unit testing for mudlet-lua
Progress so far: designed the test files layout and made a simple test for loading DB.lua. Going to set it up to run tests with the Travis CI today.
Re: Unit testing for mudlet-lua
In a surprising twist, I've reverted back to using https://github.com/vadi2/mudlet-lua for mudlet-lua since the Travis CI would like me to use my own authenticated repository. Plus it makes more sense to be using this one.
Re: Unit testing for mudlet-lua
Continuous integration is now setup: https://travis-ci.org/vadi2/mudlet-lua
So people don't have to setup busted on their own machines if they don't want to, or have to worry about re-running the tests all the time before committing.
So people don't have to setup busted on their own machines if they don't want to, or have to worry about re-running the tests all the time before committing.
Re: Unit testing for mudlet-lua
Though, as a quick note, it's generally considered bad form to commit code which breaks the tests in a project.
Re: Unit testing for mudlet-lua
The current "tests" make very little sense to me because they are completely trivial and useless in their current form - especially as they don't contain any client testing. The color echo and insert functions are known to be buggy in mudlet-lua. This would be a useful playground for test scripts that would actually help quality control.
Re: Unit testing for mudlet-lua
The tests are far from complete and the ones that are there, only focus on DB functionality as I was working on fixing bugs there - and created tests as I went along, so future similar problems would be caught.
If there are any bugs regarding cecho or insert functions, please file them on LP. At the moment it doesn't have any. The only known issue with cecho is a missing feature: it doesn't handle underline/bold/italics yet.
If there are any bugs regarding cecho or insert functions, please file them on LP. At the moment it doesn't have any. The only known issue with cecho is a missing feature: it doesn't handle underline/bold/italics yet.
Re: Unit testing for mudlet-lua
This test script shows various bugs related to the mudlet-lua color echo and insert functions. There's probably more.
Re: Unit testing for mudlet-lua
Addendum:
If I remember correctly, the cecho/cinsert functions didn't work correctly when used in conjunction with mini consoles. Has this been fixed?
If I remember correctly, the cecho/cinsert functions didn't work correctly when used in conjunction with mini consoles. Has this been fixed?
Re: Unit testing for mudlet-lua
A long while ago, I think.
I haven't ran the test script yet.
I haven't ran the test script yet.