Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Convert/tester/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Testcases example== *[[Module:Convert/sandbox/testcases]] β’ templates to be tested, with expected outputs *[[Module talk:Convert/sandbox/testcases]] β’ view test results It is not necessary to save the testcases page before viewing test results. For example, [[Module:Convert/sandbox/testcases]] could be edited to change the tests. While still editing that page, paste {{nowrap|"<code>Module talk:Convert/sandbox/testcases</code>"}} (without quotes) into the page title box under "Preview page with this template", then click "Show preview". The testcases talk page (for example, [[Module talk:Convert/sandbox/testcases]]) contains: <pre> {{#invoke:convert/sandbox/testcases|run_tests}} </pre> The testcases module page (for example, [[Module:Convert/sandbox/testcases]]) may contain: <pre> local tests = [==[ A template to be tested must be at the start of a line. Lines which do not start with a template are ignored. {{convert/sandbox|1|acre|lk=on}} 1 [[acre]] (0.40&nbsp;[[hectare|ha]]) {{convert/sandbox|1|m2|acres|lk=on}} 1 [[square metre]] (0.00025 [[acre]]s) {{convert/sandbox|0.16|/l|2|disp=table}} align="right"|0.16\n|align="right"|0.61 ]==] local p = require('Module:Convert/tester') p.tests = tests return p </pre> If wanted, the tests can be run using a template different from the one specified in the tests. For example, the following would run the tests from [[Module:Convert/sandbox/testcases]], but would change the name of each template found on that page to "<code>convert/sandbox2</code>". <pre> {{#invoke:convert/sandbox/testcases|run_tests|template=convert/sandbox2}} </pre>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)