I was just reading https://tiddlywiki.com/#TestCaseWidget which says:
The $testcase widget is designed to present interactive example test cases
(bold emphasis mine).
And I thought that having something similar, but non-interactive would make a great tool for writing automated unit tests.
The simplest, rudimentary form could look like:
<$vars foo="1" bar="2" >
<$assertequal name="Test that `foo` == `bar`" param1=<<foo>> param2=<<bar>> />
</$vars>
Which would display something like:
Test that `foo` == `bar` : OK
or
Test that `foo` == `bar` : FAIL
foo = 1
bar = 2
After the recent Working with lists in TiddlyWiki discussion, ideally such an assert widget should support at least lists as well, to spare the user from doing explicit manual voodoo with enlist
and just somehow be able to pass filters into the widget as well.
And Help with summing two variables(Solved) shows that it would be nice if such an assert widget could also wikify content passed to it.
Having such a widget would amplify the temptation to do Test Driven Development when writing wikitext logic or complex filters, when refactoring existing filters into functions etc