dev

This is the documentation page for Module:Docbunto/testcases/LDoc

Compatibility testing against LDoc. Currently tests colon mode and type modifiers.

Documentation

Package items

multiple.mul1() (function)
Function with return groups.
Returns: Result. (string)
multiple.mul2() (function)
Function with return and error tag.
Error: 'message'
Returns: Result.
multiple.mul3() (function)
Function with multiple error tags.
Errors:
'not found'
  • When multiple.lua is missing in the same directory.
'bad format'
  • When multiple.lua contains invalid UTF-8 sequences.
Returns: Result.
multiple.mul4() (function)
Function with inline return and errors.
Errors:
'not a string' (line 31)
'zero-length string' (line 34)
Returns: Name converted to uppercase. (string)
multiple.mul5() (function)
Function that raises an error.
Error: 'file not found'
Returns: Contents of file in UTF-8 charset. (string)
multiple.mul6() (function)
First no-op function. Optional type specifiers are allowed in this format. Note how these types are rendered!
Returns: (table|string|nil)
multiple.mul7(name) (function)
A function with typed args. Note the the standard tparam aliases, and how the 'opt' and 'optchain' modifiers may also be used. If the Lua function has varargs, then you may document an indefinite number of extra arguments!
Parameter: name Person's name. (string|Person|nil)
Returns: Birthday month in calendar (usually Gregorian). (string)
multiple.mul8(one, two, three, ...) (function)
Testing [opt].
Parameters:
one First parameter.
two Second parameter. (optional)
three Third parameter.
... Other parameters after/including fourth parameter. (optional)
multiple.mul9() (function)
Third no-op function. Can always put comments inline, may be multiple.
multiple.mul10(three) (function)
Function with single optional argument.
Parameter: three Third parameter. Limitations:
  • This parameter must be greater than two.
  • This parameter must be less than four.
  • Valve can now count to this number.
(optional)

Other items

person2 (table)
Implicit table can always use : notation.
Fields:
gender Has an official ID number. (boolean)
sex One of 'M' (male), 'F' (female) or 'N' (N/A). (boolean)
spouse Has a wife or husband. (boolean)
person3 (table)
Explicit table in : format.
Fields:
surname Person's surname. (string)
birthdate Person's birthdate. (string)
options List of options for person - person2. (table)
person4 (table)
An implicit table.
Fields:
name Name of person. (string)
age Age of person. (number)
person4 (table)
An explicit table. Can use tparam aliases in table definitions.
Fields:
name (string)
age (number)