Module:transliteration module testcases/documentation

Hello, you have come here looking for the meaning of the word Module:transliteration module testcases/documentation. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:transliteration module testcases/documentation, but we will also tell you about its etymology, its characteristics and you will know how to say Module:transliteration module testcases/documentation in singular and plural. Everything you need to know about the word Module:transliteration module testcases/documentation you have here. The definition of the word Module:transliteration module testcases/documentation will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:transliteration module testcases/documentation, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Returns a function that creates testcases for a single romanization function.

Can be used by placing the following code in the testcases module:

return require("Module:transliteration module testcases") {
	module = "module name", -- for instance, "grc-translit"; module must export a tr function
    examples = {
    	{ example1, expected1 },
        { example2, expected2, script_if_different_from_below },
        { example2, expected2, script_if_different_from_below, lang_if_different_from_below },
        -- and so on
        -- Strings may be inserted to act as subheaders in the table of results.
    },
    sc = "script_code", lang = "language_code",
    -- options, e.g. nolink = true
}

The 'module' argument may be the transliteration function itself if so desired.

Positional arguments are supported and still used. There are then four required and one optional argument. The required arguments are module, examples, sc and lang as above. The fifth and optional argument is options, which gather the options as above together.

Options:

nolink
If true, the items in the "test" column will not be linked.
func_before_link
A function to process the text before it is linked or language-tagged. It receives and should return a string. For even greater flexibilty, it is actually passed the first four field of the example. (Omitted fields will be received as nil. This returned string is then treated as the name of a page in Wiktionary, unless option nolink is set.
func_with_link
A function to process the text, including the linking and language-tagging. It receives as argument the first four fields of each example, with omitted fields being nil. It returns the string to be output in the text field.
output_display
This is the display option as passed to function equals of Module:UnitTests.

As with Module:UnitTests, the documentation page should have {{#invoke:testcases module name here|run_tests}}.