[JW Lua] Unit-testing with jwlua scripts?

Nick Mazuk nick at nickmazuk.com
Wed Sep 15 17:36:39 CEST 2021


I see what both of you mean, now! I was thinking of ways in which you could import your JW Lua code into the testing framework, not that you could import the testing framework into JW Lua. Yes, this should work.

Perhaps it might be good practice to start returning the main functions (e.g., in this script ( https://github.com/Nick-Mazuk/jw-lua-scripts/blob/master/src/articulation_delete_duplicates.lua ) , the articulation_delete_duplicates function). Then we could have a separate test file called *.test.lua (where the "*" is the original file name).

Nick

On Tue, Sep 14, 2021 at 10:04 PM, Thomas Weber < thomas.weber at notengrafik.com > wrote:

> 
> Am 14.09.21 um 14:01 schrieb Robert Patterson:
> 
> 
>> It looks to me like this one ( https://github.com/bjornbytes/lust ) would
>> work in JW Lua. Basically any framework that is pure lua could be required
>> into JW Lua. (And compatible with Lua 5.2, but if you've got the lua code
>> for the framework, as in this example, that's a given.)
>> 
>> 
> 
> 
> 
> 
> 
> 
> 
> 
> That looks good.  The ANSI color escapes are a bit irritating, so I
> created a pull request ( https://github.com/bjornbytes/lust/pull/4 ) to get
> it fixed.
> 
> 
> 
> It's a bit of a weird library because it "pollutes" itself with test suite
> state, but it seems to clean up properly after itself and we don't have to
> worry about concurrency and race conditions with JWLua.
> 
> 
> 
> I realize the pull request was already merged – that was quick!
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> Notengrafik Berlin GmbH
> HRB 150007
> 
> UstID: DE 289234097
> Geschäftsführer:
> Thomas Weber und Werner J. Wolff
> 
> fon: +49 30 25359505
> Friedrichstraße 23a
> 10969 Berlin
> 
> notengrafik. com ( http://notengrafik.com/ )
> 
> _______________________________________________
> JWLua mailing list
> JWLua@ jwmusic. nu ( JWLua at jwmusic.nu )
> http:/ / jwmusic. nu/ mailman/ listinfo/ jwlua_jwmusic. nu (
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu )
> 
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20210915/51fe153d/attachment.html>


More information about the JWLua mailing list