[DGD] Unit tests for LPC
Felix A. Croes
felix at dworkin.nl
Mon Apr 29 13:58:58 CEST 2019
nikoroleva <natasha.i.koroleva at gmail.com> wrote:
> A few months ago I wrote some code for unit testing my LPC. It is
> rudimentary, but it functions. I think the recent changes to
> Continuations will be useful in a rewrite by making each test object a
> Continuation and then chaining them all together which seems to
> simplify everything about collecting them into an array and iterating.
> I would probably change some other things knowing now what I know
> after writing it, but it covers a thousand or so expectations in a
> second or less; so not too bad I reckon.
My original motivation for creating continuations was distributed
continuations as an abstraction of parallelisation. Everything else
came later.
Continuations will continue to evolve.
>[...]
> The experience also brought my lack of comprehending floats into sharp
> focus. I try from time to time to learn them, but the things I read
> seem to require more CS background and/or intuition than I possess.
> The equality test works to several places, but it still feels a bit
> hinky.
LPC floats are similar enough to C/C++ floats that you should be able
to copy/adapt existing code.
> Writing a coverage reporter seems quite daunting as well.
> cloud-server's LPC parser seems like a reasonable place to start, but
> maybe it's something the interpreter is better suited for anyway,
> particularly when it comes to code wrapped up in #directives. I have
> no idea.
Perhaps an extension module can help with this in the future. I'm
finding that implementing the JIT compiler leads you part of the
way to a full decompiler.
>[...]
> How would you go about writing a framework for unit testing LPC code?
I'm not sure yet. I will return to answer this fully at some later date.
Regards,
Felix Croes
More information about the DGD
mailing list