The compliment is well-deserved ;-)

Yes, after my mind settled down on what I wrote, I realized this too.
The annotation nor the anonymous function itself (a partial could have
served the same function) wasn't necessary. So it's just plain cool
instead of very cool.

It was mostly my sudden enthousiasm for the possibilities this
approach opens for an alternative testing approach. I always thought
about the unit module as having to write an explicit test suite with
the unit annotations and never realized that the unit:assert functions
can very well be used on their own. In my case in the context of
generative/property-based testing.


Cheers,
--Marc



On Wed, Jan 13, 2016 at 8:43 AM, Christian Grün
<christian.gr...@gmail.com> wrote:
> Hi Marc,
>
>> BaseX, the gift that keeps on giving, thanks to all that make it possible.
>
> One of the nicest compliments that we got so far… Thanks ;)
>
>> So, a bit to my amazement, the following works:
>>
>>     let $equals :=
>>       %unit:test
>>       function($a,$b) {
>>         unit:assert-equals($a,$b, 'Not equal')
>>       }
>>     return
>>       $equals(4,3)
>
> Yes, it does, it will do so in the future. To add some more surprises:
> You can omit the %unit:test annotation, because it’s the
> unit:assert-equals function that raises the error in the XQUnit
> namespace.
>
> Cheers,
> Christian



-- 
--Marc

Reply via email to