Content deleted Content added
Line 299:
:Not sure I follow — a string comparison of the output is precisely what the module's <syntaxhighlight lang="lua" inline>TestCase:templateOutputIsEqual()</syntaxhighlight> function does; the {{tlx|Collapsible test case}} template — or any of the templates, with {{para|_collapsible|yes}} set — will even automatically collapse any testcase where the results are the same. (As well as coloring the top bar of the collapsible box green (same output) vs. yellow (differences detected).)
:However, it's often the case that differences between the main version of a template and its sandbox version are '''intentional'''. (They'll be present whenever development is being done on the sandbox version of the code, for example.) So, characterizing differences as "TEST FAIL!" isn't strictly accurate, as having the same output isn't "success" and having ''different'' output isn't "failure". The point, when there are differences, is to demonstrate/examine how/whether the sandbox version has '''improved''' the output, vs. the live code. (If so, then a request can be made to transfer the sandbox code to the live template. At which point, the differences go away.) [[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 23:38, 6 October 2024 (UTC)
:(Template test cases are therefore not like traditional programming [[unit test]]s, where the result of some code is compared to a known expected value, and any deviation represents a failure to perform as expected. Template test cases compare and contrast two versions of the same template, and any differences in output are ''interesting'' as a means of evaluating the code changes that created those differences.) [[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 23:51, 6 October 2024 (UTC)
|