Wikipedia:Template sandbox and test cases: Difference between revisions

m
Reverted edits by 27.55.155.193 (talk) (HG) (3.4.4)
m (Reverted edits by 27.55.155.193 (talk) (HG) (3.4.4))
# Add your experimental code to <code>Template:X/sandbox</code>. To test your code, save the page, and go to the /testcases page. Often you will need to [[WP:PURGE|purge]] the /testcases page to see the updated results; there is a link to do that included in the {{tl|testcases notice}} template. After you've purged the page, compare the results for the main template with the results from the sandbox, and if everything looks okay, you can update the main template. However, be wary of missing test cases and of code that can only be tested in certain namespaces or on certain pages.
 
== How to update existing /sandbox and /testcases subpages ==
เยี่ยม ปี้
 
To make a change to a template which already has /sandbox and /testcases subpages, the process is similar to the above.
 
# The /sandbox may not have the latest version of the template code in it, so before you make a change, you need to synchronize it with the main template. Copy the entire contents of the main template to the /sandbox subpage, and save the page. Your edit summary should be something like "synchronize with the main template", or simply "sync".
# Have fun editing the sandbox. When you have some code you want to test, save the page.
# If you have added any new features or changed any parameters, you should add new test cases to the /testcases subpage so that they can be tested. Also, bear in mind that the existing test cases may not be complete. It's okay to rewrite the test cases if they aren't useful for what you're trying to achieve, but also consider editors who may use the test cases after you.
# [[WP:PURGE|Purge]] the /testcases page to update the results.
# Verify that the test case results are correct. If everything looks good, copy the code from the sandbox to the main template.
 
== Adding test cases ==