Module talk:LuaCall/testcases
{{#invoke:LuaCall|main|a=test |b=7|string.rep(a,b)}}
test test test test test test test
{{#invoke:LuaCall|main|pattern=(%a)|replace=%1.|string=I can't get no satisfaction|mw.ustring.gsub(string,pattern,replace)|reserved_return=1}}
I. c.a.n.'t. g.e.t. n.o. s.a.t.i.s.f.a.c.t.i.o.n.
{{#invoke:LuaCall|main|pattern=(%a)|replace=%1.|string=I can't get no satisfaction|mw.ustring.gsub(string,pattern,replace)|reserved_return=2}}
22
{{#invoke:LuaCall|main|value=1.4512|math.ceil(value)}}
2
{{#invoke:LuaCall|main|value=1.4512|math.modf(value)}}
1
{{#invoke:LuaCall|main|value=1.4512|math.modf(value)|reserved_return=2}}
0.4512
{{#invoke:LuaCall|main|value=... that the '''[[Privacy and Civil Liberties Oversight Board report on mass surveillance]]''' recommended against imposing a [[data retention]] requirement on U.S. phone companies?|string.len(value)}}
181
- For comparison with n:Template:Evalx:
{{#invoke:LuaCall|main|value=abcd|start=2|end=3|string.sub(value,start,end)}}
bc
call()
[edit]{{#invoke:LuaCall|call|mw.log|<pre>p</pre>, <ref>r</ref>, <nowiki>n</nowiki>, <code>c</code>, {{#tag:pre|p2}}, {{#tag:ref|r2}}, {{#tag:nowiki|n2}}, {{#tag:code|c2}}, {{#invoke:LuaCall|call|mw.log|#invoke}}, {{Ping|Ans}}, [[User:Ans]]}}
will display
'"`UNIQ--pre-0000000F-QINU`"', '"`UNIQ--ref-00000010-QINU`"', '"`UNIQ--nowiki-00000011-QINU`"', <code>c</code>, '"`UNIQ--pre-00000012-QINU`"', '"`UNIQ--ref-00000013-QINU`"', '"`UNIQ--nowiki-00000014-QINU`"', <code>c2</code>, , <span class="template-ping">@[[User:Ans|Ans]]:</span>, [[User:Ans]]
in Lua logs. --Ans (talk) 05:29, 15 March 2019 (UTC)
{{#invoke:LuaCall|call|mw.ustring.sub|<pre>p</pre>, <ref>r</ref>, <nowiki>n</nowiki>, <code>c</code>, {{#tag:pre|p2}}, {{#tag:ref|r2}}, {{#tag:nowiki|n2}}, {{#tag:code|c2}}, {{#invoke:LuaCall|call|mw.log|#invoke}}, {{Ping|Ans}}, [[User:Ans]]}}
will display
p
, [5], n, c
,
p2
, [6], n2, c2
, , @Ans:, User:Ans
--Ans (talk) 05:50, 15 March 2019 (UTC)
nowiki
[edit]{{#invoke:LuaCall|call|mw.log|nowiki1}}, {{PAGENAME}}, &&, <pre>p</pre>, <ref>r</ref>, <nowiki>n</nowiki>, <code>c</code>, {{#tag:pre|p2}}, {{#tag:ref|r2}}, {{#tag:nowiki|n2}}, {{#tag:code|c2}}, {{#invoke:LuaCall|call|mw.log|#invoke}}, {{Ping|Ans}}, [[User:Ans]]
, LuaCall/testcases, &&,
p
, [7], n[[User:Ans]], <nowiki>n2</nowiki>, <code>c</code>,
p2
, [8], n2, <code>c2</code>, , <span class="template-ping">@[[User:Ans|Ans]]:</span>, [[User:Ans]]
{{#invoke:LuaCall|call|mw.log|nowiki1}}, {{PAGENAME}}, &&, <pre>p</pre>, <ref>r</ref>, <nowiki>n</nowiki>, <code>c</code>, {{#tag:pre|p2}}, {{#tag:ref|r2}}, {{#tag:nowiki|n2}}, {{#tag:code|c2}}, {{#invoke:LuaCall|call|mw.log|#invoke}}, {{Ping|Ans}}, User:Ans
, LuaCall/testcases, &&,
p
, [11], n[[User:Ans]], <nowiki>n2</nowiki>, <code>c</code>,
p2
, [12], n2, <code>c2</code>, , <span class="template-ping">@Ans:</span>, User:Ans
passing parameter
[edit]2{{}}x2{{}}x
yes
3
3
yesyesyes
1
[yes yes]. {{cite web}}
: Check |url=
value (help); Missing or empty |title=
(help); Text "yes" ignored (help); Text "yes" ignored (help); Text "yes" ignored (help); Text "yes" ignored (help); Text "yes" ignored (help); Text "yes" ignored (help)
table
{{{1}}}{{{1}}}
Script error: The function "wrap2" does not exist.