Content deleted Content added
→Test group order: reply |
→Alternative implementation: new section |
||
Line 8:
Hi UnitTesters. I'm failing to find the proper format for the nesting tests at [[Module:Delink/testcases]] function test_nesting. How do I do that? What I want is the expanded result to be compared to the non-expanded expected cases. [[User:Martijn Hoekstra|Martijn Hoekstra]] ([[User talk:Martijn Hoekstra|talk]]) 15:50, 3 April 2013 (UTC)
:I've fixed the problem using the nowiki option. The option isn't documented yet, so I might go through and add it when I have a second. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 19:10, 3 April 2013 (UTC)
== Alternative implementation ==
This module has several shortcomings:
* logic and presentation are mixed together, making it impossible to present the tests in different formats
* as a consequence, it is not possible to run tests in the debug console (which is quite convenient when you need to change the tests)
* there is line number for failed assertions
* errors thrown by tested code are not caught
I created an alternative test module in hu.wikipedia and would welcome any comments or feature requests. The module is at [[:hu:Modul:Homokozó/Tgr/ScribuntoUnit]], a usage example is at [[:hu:Modul:Homokozó/Tgr/Set/tests]] (the documentation is in Hungarian, but comments and variable names are in English, and the code follows xUnit conventions, so understanding it shouldn't be a problem). It throws exceptions from failed assertions, builds a result table based on which tests throw exception/error, and can then present the results in any way; I believe the separation of actual testing and display code makes it more maintainable and reusable. --[[User:Tgr|Tgr]] ([[User talk:Tgr|talk]]) 15:17, 25 May 2013 (UTC)
|