Hmm, it would probably be better if any unit tests were "self-contained" or relied on other data prefixed with UnitTest/data/ or some such. I'll probably write a bundle of them on my next pass and work out a system.
On Tuesday, 19 December 2017 15:46:38 UTC-6, Diego Mesa wrote: > > Hey Evan, > > Were you thinking something like this? Or peraps something more > self-contained where the input is defined as a field of this tiddler? Let > me know! > > Diego > > On Tuesday, December 19, 2017 at 3:00:27 PM UTC-6, Evan Balster wrote: >> >> Hey, Diego — >> >> Thanks again for all your hard work. With a plugin of this complexity, Im >>> wondering if there should be "unit tests" tiddler that could keep track of >>> the various corner cases proposed here and that you also identify. >>> >> >> This, times a million. I had already been thinking about it. >> >> >> *I would like to solicit unit test contributions from users of the plugin*, >> following this format: >> >> - Exported as JSON or TID >> - Tagged "UnitTest" >> - Text is a formula in (= mushroom brackets =) that should produce >> TRUE >> - Title Format: >> - For functions: UnitTest/Functions/<function_name>/<test_name> >> - For operators: UnitTest/Operators/<operator_name>/<test_name> >> - For other stuff: UnitTest/Other/<test_name> >> >> >> In other news I'm realizing that selective evaluation is going to be >> necessary for IFERROR to work at all, and to efficiently implement things >> like IF and SWITCH which shouldn't be computing the arguments they don't >> use. In the long term I expect to explore some aggressive optimizations >> for formulas, depending on what uses I put it to. >> >> >> On Tuesday, 19 December 2017 14:31:08 UTC-6, Diego Mesa wrote: >>> >>> Hey Evan, >>> >>> Thanks again for all your hard work. With a plugin of this complexity, >>> Im wondering if there should be "unit tests" tiddler that could keep track >>> of the various corner cases proposed here and that you also identify. >>> >>> Also, if/when new functionality is added we can also make sure none of >>> the previous unexpectedly change. >>> >>> Best, >>> Diego >>> >>> On Tuesday, December 19, 2017 at 11:38:58 AM UTC-6, Evan Balster wrote: >>>> >>>> Hey, Diego — >>>> >>>> Noticed the COUNT error last night and fixed it in repo. Good catch on >>>> the IF error. I've also noticed that IFERROR won't behave correctly and >>>> I'll be looking into fixing that at some point. >>>> >>>> For the impatient, I'm attaching patch files that can be imported into >>>> a wiki that already has the plugin. >>>> >>>> On Tuesday, 19 December 2017 10:24:01 UTC-6, Diego Mesa wrote: >>>>> >>>>> Hey Evan, >>>>> >>>>> In your demo, when I try: >>>>> >>>>> - count([tag[Expenses]]) >>>>> - `ComputeError: ReferenceError: V_Num is not defined operand: >>>>> [Operand function-call]` >>>>> - [tag[Expenses]count[]] >>>>> - [3.00] >>>>> - This is normal >>>>> - IF(([tag[Expenses]count[]]=*3*),"yes","no") >>>>> - `ValueError: TypeError: value.asString is not a function value: >>>>> no` >>>>> - Where *3* can be either of the below without changing the >>>>> returned error >>>>> - 3.00 >>>>> - [3.00] >>>>> - "[3.00]" >>>>> - "3" >>>>> >>>>> Thank you very much for your hard work on this plugin. Mat is right - >>>>> you brought the chairs to the dinner party! >>>>> >>>>> Diego >>>>> >>>>> >>>>> >>>>> On Monday, December 18, 2017 at 10:25:51 PM UTC-6, Evan Balster wrote: >>>>>> >>>>>> Time will tell. It's my experience that hasty decisions about syntax >>>>>> can make language design tougher later on, so I'm not inclined to jump >>>>>> the >>>>>> gun on brevity options. One of the tough things about filters, in >>>>>> particular, is that the multi-run syntax should be supported in the >>>>>> future. That has some weird implications. >>>>>> >>>>>> It wouldn't be unreasonable to have an arraylinks function, though. >>>>>> >>>>>> On Monday, 18 December 2017 22:19:46 UTC-6, Mat wrote: >>>>>>> >>>>>>> (= arraystring([tag[Expenses]], "[[", "]] [[", "]]") >>>>>>>> >>>>>>> >>>>>>> A bit cumbersome. >>>>>>> Maybe (= array*links*([tag[Expenses]]) =) >>>>>>> >>>>>>> >>>>>>> ...and, btw, given how filters are delimited with outer square >>>>>>> brackets, just maybe parentheses could be omitted for filters? >>>>>>> >>>>>>> (= arraylinks*[*tag[Expenses]*]* =) >>>>>>> >>>>>>> (= sum*[*tag[Expenses]get[value]*]* =) >>>>>>> >>>>>>> <:-) >>>>>>> >>>>>> -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6b6b0a38-9f32-41d5-8a69-9050b9aae89d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

