Jump to content

Module talk:Error

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by DePiep (talk | contribs) at 13:37, 4 April 2013 (Some tests: adding). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Some tests

I have edited Module:Error/testcases [1] and Template:Error/sandbox [2]. If these edits are not helpful, feel free to revert. My self comments:

  • Adding |tag={{{tag}}} to the /sandbox looks obvious, since we want to pass that parameter.
  • /sandbox: Merging params into {{{message|{{{1}}}}}} in the /sandbox is done to copy the behaviour of the existing template. Since handling spaces and priorities in parameter handling will remain, we would like to copy that behaviour, whatever the implications for Module. Now it looks like the template {{Error/sandbox}} passes all its template-space {{Error/testcases}} (which is just a limited set).
  • In Module:Error/testcases, I have added more tests (and grouped them). Also, all current tests are repeated for {{Error/sandbox}} because there seems to be an effect between UnitTest and /sandbox mode. UnitTest failed:
  • input "0" and "false" (probably the t/f logic is tricked) No, my typo in the testcases ;-) -DePiep (talk) 13:37, 4 April 2013 (UTC)[reply]
  • Input like {{Error}} (that is, no param1 at all) produces testcases: {{{1}}} (vs.) Script error. I guess this is because of the added check: or error('no message specified', 2) in the module. The old template does not have this check. If this is not for debugging, that one could go? It should return {{{1}}} I'd say. (See also the nowiki return texts: class "scribunto-error" was added).
Adding: This could imply that there is only message = arg[1] to consider (plus a nil-check on that), since the message will only enter through param1. Template param Message is not the same asmodule param message. -DePiep (talk) 13:37, 4 April 2013 (UTC)[reply]

More fails I did not see. Hope I did help. -DePiep (talk) 13:27, 4 April 2013 (UTC)[reply]

Some addings. -DePiep (talk) 13:37, 4 April 2013 (UTC)[reply]