Module:ScribuntoUnit/doc: Difference between revisions

Content deleted Content added
No edit summary
Tag: Reverted
Tag: Reverted
Line 131:
self:assertDeepEquals(table1, table2)
</syntaxhighlight>
 
=== assertParserFunctionEquals ===
 
<syntaxhighlight lang="lua">
self:assertParserFunctionEquals(expected, pfname, args, message)
</syntaxhighlight>
 
This tests whether the first parameter equals a parser function call. The second parameter is the parser function name, and the third parameter is a table of the parser function arguments.
 
<syntaxhighlight lang="lua">
self:assertParserFunctionEquals(4, 'msg:add', {2, 2}) -- true if {{msg:add|2|2}} equals 4
</syntaxhighlight>
 
Note that some tags written in XML notation cannot be tested correctly; see the note for the <code>assertResultEquals</code> function below.
 
=== assertTemplateEquals ===