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:IPA symbol/sandbox/testcases
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!
-- Unit tests for [[Module:IPA symbol]]. Click talk page to run tests. local p = require('Module:UnitTests') -- self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main||output=name}}', '{{IPAsym|}}') -- currently: custom_error corresponds with para2 (set message for not-in-list error; currently default return = error message. -- currently: custom_output corresponds with para3 in IPAsym (set message for blank input; default return = '' (blank)) --- note: para2 and para3 do interact (para3 defaults to para2 behaviour), but their module parameters do not. function p:test_a_basic_IPA_symbols() self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|m|output=name}}', '{{IPAsym|m}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|p|output=name}}', '{{IPAsym|p}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|Κ|output=name}}', '{{IPAsym|Κ}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|147|output=name}}', '{{IPAsym|147}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|Ι¦|output=name}}', '{{IPAsym|Ι¦}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|hΜ |output=name}}', '{{IPAsym|hΜ }}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|146 424|output=name}}', '{{IPAsym|146 424}}') end function p:test_b_blank_input() self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main||output=name}}', '{{IPAsym|}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|output=name}}', '{{IPAsym}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main| |output=name}}', '{{IPAsym| }}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main| |output=name}}', '{{IPAsym| }}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main| m |output=name}}', '{{IPAsym| m }}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main||custom_error=para2msg|output=name}}', '{{IPAsym||para2msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main||custom_error=para2msg||output=name}}', '{{IPAsym||para2msg|}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main||custom_error=para2msg|custom_output=para3msg|output=name}}', '{{IPAsym||para2msg|para3msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main||custom_output=para3msg|output=name}}', '{{IPAsym||3=para3msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|||custom_output=para3msg|output=name}}', '{{IPAsym|||3=para3msg}}') end function p:test_c_error_options() self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|xyz|output=name}}', '{{IPAsym|xyz}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|xyz|custom_error=para2msg|output=name}}', '{{IPAsym|xyz|para2msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|xyz|custom_error=para2msg|output=name}}', '{{IPAsym|xyz|para2msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|xyz|custom_error=para2msg|custom_output=|output=name}}', '{{IPAsym|xyz|para2msg|}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|xyz|custom_error=para2msg|custom_output=para3msg|output=name}}', '{{IPAsym|xyz|para2msg|para3msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|xyz|custom_output=para3msg|output=name}}', '{{IPAsym|xyz|3=para3msg}}') end function p:test_d_error_options_ineffective() -- set messages should not be shown in OK input self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|m|output=name}}', '{{IPAsym|m}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|m|custom_error=para2msg|output=name}}', '{{IPAsym|m|para2msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|m|custom_error=para2msg|output=name}}', '{{IPAsym|m|para2msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|m|custom_error=para2msg|custom_output=|output=name}}', '{{IPAsym|m|para2msg|}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|m|custom_error=para2msg|custom_output=para3msg|output=name}}', '{{IPAsym|m|para2msg|para3msg}}') self:preprocess_equals_preprocess('{{#invoke:IPA symbol/sandbox|main|m|custom_output=para3msg|output=name}}', '{{IPAsym|m||3=para3msg}}') end return p
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)
Template used on this page:
Module:IPA symbol/sandbox/testcases/doc
(
edit
)