mustache/spec — Issue #33: Make lambda test cases language independent
Author: cjerdonek
Created: 2012-01-07 18:41:57+00:00
State: open

Many [languages that support](http://mustache.github.com/) Mustache (especially non-scripting languages like C++, Java, C#, etc) are not currently supported by the [lambda test cases](https://github.com/mustache/spec/blob/master/specs/~lambdas.yml). It is also non-trivial to write new test cases in the current form.

It occurs to me that the lambda test cases could be written in a language-independent way. Naively, one might think that a dictionary for each lambda of input-output pairs would suffice to define the lambdas for test cases purposes (similar to how partial data is handled in the [partial test cases](https://github.com/mustache/spec/blob/master/specs/partials.yml).

However, given our issue #30 discussion, something like a list of triples of (lambda called, expected input, expected output) might be closer to the appropriate structure. The right structure would also address the [question](https://github.com/mustache/spec/issues/30#issuecomment-3334275) of how best to test things like lambda evaluation order and non-caching independent of each other.

Implementors would simply need to change or add to their test harnesses code (in their respective languages) to create the lambdas from that data.