"వికీపీడియా:Lua" కూర్పుల మధ్య తేడాలు

చి
(→‎Unit testing: Let's keep the same name we use in Template namespaces.)
చి (→‎Unit testing: one more)
A unit testing framework for Lua scripts on Wikipedia is available at [[Module:UnitTests]]. It allows you to execute your script on a given set of inputs and verify that the expected outputs are produced. Unit tests are especially useful for rapidly detecting regressions, where modifications to a script introduce new problems.
 
By convention, unit tests for a module like [[Module:Bananas]] are placed in [[Module:Bananas/testcases]], and are executed on [[Module talk:Bananas/testcases]] with e.g. <code><nowiki>{{#invoke: Bananas/testcases | run_tests}}</nowiki></code>. Test methods must begin with "test". A simple example from [[Module:Bananas/teststestcases]] is below.
<syntaxhighlight lang="lua">
-- Unit tests for [[Module:Bananas]]. Click talk page to run tests.
0

edits

"https://te.wikipedia.org/wiki/ప్రత్యేక:MobileDiff/1387549" నుండి వెలికితీశారు