lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 03/31/2014 05:36 AM, Elias Barrionovo wrote:
On Thu, Mar 27, 2014 at 11:32 PM, Peng Zhicheng
<pengzhicheng1986@gmail.com>  wrote:
I'll check it so see whether I can integrate that into my unit testing
infrustructure.
Cool! BTW, is your "unit testing infrustructure" open sourced? If it
is, could you provide a link?



LOL, by `infrustructure', I was kinda jokingly embelish my words. :) I might have also
used `framework' instead. but actually it was merely hundreds of lines of Lua library I
had written for run. It was so simple and crude that I felt ashamed to _release_ it to public.

and now that there are many more decent and elegant testing libraries for Lua available,
such as busted[1], a great feature of which I liked very much is nested spec description.
I'd see my library as my `poor man's testing _infrustructure_', :P

But if you are really interested, I don't mind at all to provide. I will be really grad in case it
would ever be useful for anybody.

so attached is a slightly tidy version of my original code, together with stuffs such as
a README file and some example scripts et etera.
I am not good at giving a name for the package, sorry if you feel it confusing.

currently I am not planning to extend or improve it since I mainly use it for my sparetime
projects and it is really enough for my use, so I ain't gonna upload it to a public repository.
however, anybody finding it useful and willing to maintain the code is welcome to publish it
anywhere he likes.


here's some brief introduction:

the concepts are quite simple, similar to those of the QUnit[2] framework(not joking here)
and the Hamcrest[3] libray:

   you register testcases by using anonyous functions, instead of writing functions whose
   names must matches a special pattern (e.g. test_foo or testFoo).

   and, not like many other testing tools, which often have many assert functions (like
   assertEq, assertTrue, assertGreaterThan, and so on), there is excact _one_ assert
   function in my library, combined with what I called predicates (a.k.a. `matchers').


best regards.

----------------------------------------------------
[1] http://olivinelabs.com/busted/
[2] http://qunitjs.com/
[3] http://hamcrest.org/


Attachment: latest.tar.gz
Description: application/gzip