2016-04-17 15:48:03 +00:00
<!DOCTYPE html>
< html dir = "ltr" >
< head >
< meta http-equiv = "content-type" content = "text/html;charset=UTF-8" / >
< title > Diagnostics/Scribunto/Luaj - XOWA< / title >
< link rel = "shortcut icon" href = "https://gnosygnu.github.io/xowa/xowa_logo.png" / >
< link rel = "stylesheet" href = "https://gnosygnu.github.io/xowa/xowa_common.css" type = "text/css" >
< / head >
< body class = "mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck = "false" >
< div id = "mw-page-base" class = "noprint" > < / div >
< div id = "mw-head-base" class = "noprint" > < / div >
< div id = "content" class = "mw-body" >
< h1 id = "firstHeading" class = "firstHeading" > < span > Diagnostics/Scribunto/Luaj< / span > < / h1 >
< div id = "bodyContent" class = "mw-body-content" >
< div id = "siteSub" > From XOWA: the free, open-source, offline wiki application< / div >
< div id = "contentSub" > < / div >
< div id = "mw-content-text" lang = "en" dir = "ltr" class = "mw-content-ltr" >
< h2 >
< span class = "mw-headline" id = "Luaj" > Luaj< / span >
< / h2 >
< ul >
< li >
Applies to the Luaj engine (as opposed to the Lua engine)
< / li >
< li >
2016-10-24 01:41:50 +00:00
Calls code in < a href = "http://xowa.org/home/wiki/Module:Diagnostics/Luaj.html" id = "xolnki_2" title = "Module:Diagnostics/Luaj" > Module:Diagnostics/Luaj< / a >
2016-04-17 15:48:03 +00:00
< / li >
< li >
Tests changes to the luaj_xowa.jar
< / li >
< li >
Further notes available at < a href = "http://xowa.org/home/wiki/App/Xtn/Mediawiki/Scribunto/Luaj.html" id = "xolnki_3" title = "App/Xtn/Mediawiki/Scribunto/Luaj" > App/Xtn/Mediawiki/Scribunto/Luaj< / a >
< / li >
< / ul >
< h3 >
< span class = "mw-headline" id = "2.0.3_errors_fixed_in_3.0" > 2.0.3 errors fixed in 3.0< / span >
< / h3 >
< table class = "wikitable" >
< tr >
< th >
name
< / th >
< th >
code
< / th >
< th >
actl
< / th >
< th >
rslt
< / th >
< / tr >
< tr >
< td >
string.format fails for bad format; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_format_2|%d:%02.f|3|4}}
< / td >
< td >
3:04
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
os.time does not handle dates before 1970 on Windows; fails with false on Windows< br >
NOTE: always fails on Windows with the lua engine
< / td >
< td >
{{#invoke:Diagnostics/Luaj|os_time|1234|05|06}}
< / td >
< td >
true
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
pairs.next fails when setting val to null; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|pairs_next}}
< / td >
< td >
ok
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< / table >
< h3 >
< span class = "mw-headline" id = "2.0.3_features_removed_from_3.0" > 2.0.3 features removed from 3.0< / span >
< / h3 >
< table class = "wikitable" >
< tr >
< th >
name
< / th >
< th >
code
< / th >
< th >
actl
< / th >
< th >
rslt
< / th >
< / tr >
< tr >
< td >
string.gfind deprecated; should be alias to gmatch; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gfind|ab cd|%w+}}
< / td >
< td >
ab
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
tonumber returns original value if value has decimal and base is 10; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|tonumber|12.34|10}}
< / td >
< td >
12.34
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
math.log10 deprecated; now calls Math.log10; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|math_log10|100}}
< / td >
< td >
2
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
math.mod deprecated; now aliased to math.fmod; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|math_mod|3|2}}
< / td >
< td >
1
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
table.maxn deprecated; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|table_maxn}}
< / td >
< td >
3
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
table.getn deprecated -- key_is_num; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|table_getn__key_is_num}}
< / td >
< td >
3
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
table.getn deprecated -- key_is_str; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|table_getn__key_is_str}}
< / td >
< td >
0
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
automatic arg variable in varargs function deprecated; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|varargs_arg}}
< / td >
< td >
a
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< / table >
< h3 >
< span class = "mw-headline" id = "3.0_defects" > 3.0 defects< / span >
< / h3 >
< table class = "wikitable" >
< tr >
< th >
name
< / th >
< th >
code
< / th >
< th >
actl
< / th >
< th >
rslt
< / th >
< / tr >
< tr >
< td >
tonumber should trim all white space, not just \s; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|value_tonumber_trim}}
< / td >
< td >
123
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.rep fails if negative repetition; return ""; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_rep_test|a|-1}}
< / td >
< td >
pass:
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.gsub fails with ArrayIndexOutOfBoundsException; check for OutOfBounds; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gsub|a#b|#|}}
< / td >
< td >
ab
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.gsub fails if src is empty string; exit early if empty; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gsub||%b< > |}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.gmatch: non-match
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gmatch|a|[^,]*}}
< / td >
< td >
a;;
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.gmatch: match
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gmatch|a,b|[^,]*}}
< / td >
< td >
a;;b;;
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.gmatch: convert example; plain text
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gmatch_convert|a}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.gmatch: convert example; lnki
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gmatch_convert|[[a]]}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.format does not use format args for double; call java.lang.String.format; fails with 1.234
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_format|%.1f|1.234}}
< / td >
< td >
1.2
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.format fails for bad format; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_format|(%0.1f%%)|1.234}}
< / td >
< td >
(1.2%)
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.format fails if no number after "."; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_format|%02.f|3}}
< / td >
< td >
03
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.format fails for char; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_format|%c|97}}
< / td >
< td >
a
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
string.format fails for multibyte chars; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_format|âbç%f|1}}
< / td >
< td >
âbç1.0
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
multibyte strings not supported; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_multibyte_2}}
< / td >
< td >
â
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
multibyte strings not supported; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_multibyte_3}}
< / td >
< td >
อา
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
multibyte chars in lua variables; used to return "?"
< / td >
< td >
{{#invoke:Diagnostics/Luaj|ustring_match_multibyte|𠀀}}
< / td >
< td >
𠀀
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
handle backslash-escaped sequences like \239\191\185; used to return "11"
< / td >
< td >
{{#invoke:Diagnostics/Luaj|multibyte__backslash_escaped}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
surrogate pair chars not supported; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_surrogate_pair}}
< / td >
< td >
1
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
table.concat fails if end is nil; convert nil to list len; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|table_concat|.|1||a|b|c}}
< / td >
< td >
a.b.c
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
table.concat fails if sep is nil; convert nil to ""; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|table_concat_nil_sep}}
< / td >
< td >
ab
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
2016-10-20 14:59:39 +00:00
< tr >
< td >
table.concat fails if 1st argument is nil; fails with "bad argument: string expected, got nil"
< / td >
< td >
{{#invoke:Diagnostics/Luaj|table_remove_nil_arg_at_pos_1}}
< / td >
< td >
ab
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
2016-04-17 15:48:03 +00:00
< tr >
< td >
os_date does not accept utc argument; fails with ""< br >
NOTE: test assumes EST / EDT; if ! is not applied, then date would be 1969-12-31
< / td >
< td >
{{#invoke:Diagnostics/Luaj|os_date|!*t|3600}}
< / td >
< td >
1970-01-01
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
os_date non-utc check;
< / td >
< td >
{{#invoke:Diagnostics/Luaj|os_date|*t|0}}
< / td >
< td >
1969-12-31
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
os_date format: %e; fails with ""; NOTE: test assumes time zone within 11 hours of UTC
< / td >
< td >
{{#invoke:Diagnostics/Luaj|os_date_format|%e|2014|07|15|1|2|3}}
< / td >
< td >
15
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
os_date format: %R; fails with ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|os_date_format|%R|2014|07|15|13|2|3}}
< / td >
< td >
13:02
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
match.balanced: fails with out of bounds;
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_match|a|%b()}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
match.balanced: fails with out of bounds; ^ at beginning
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_match|a|^(.) ?%b()}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
match.frontier:error
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gmatch|a|%f[%a]b}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
match.frontier:bad-implementation; used to return ""
< / td >
< td >
{{#invoke:Diagnostics/Luaj|lua_match|bz|%f[%a][%a]z$}}
< / td >
< td >
bz
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
tonumber hex fails if incomplete
< / td >
< td >
{{#invoke:Diagnostics/Luaj|tonumber_hex|0x}}
< / td >
< td >
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
< tr >
< td >
tonumber hex check
< / td >
< td >
{{#invoke:Diagnostics/Luaj|tonumber_hex|0xFF}}
< / td >
< td >
255
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
2016-09-26 02:22:56 +00:00
< tr >
< td >
string.gsub does not match $ at end of string
< / td >
< td >
{{#invoke:Diagnostics/Luaj|string_gsub|ab|e?$|1}}
< / td >
< td >
abe
< / td >
< td >
< span style = 'color: green;' > pass< / span >
< / td >
< / tr >
2016-04-17 15:48:03 +00:00
< / table >
2016-09-12 01:53:06 +00:00
2016-04-17 15:48:03 +00:00
< / div >
< / div >
< / div >
< div id = "mw-head" class = "noprint" >
< div id = "left-navigation" >
< div id = "p-namespaces" class = "vectorTabs" >
< h3 > Namespaces< / h3 >
< ul >
< li id = "ca-nstab-main" class = "selected" > < span > < a id = "ca-nstab-main-href" href = "index.html" > Page< / a > < / span > < / li >
< / ul >
< / div >
< / div >
< / div >
< div id = 'mw-panel' class = 'noprint' >
< div id = 'p-logo' >
< a style = "background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href = "http://xowa.org/" title = "Visit the main page" > < / a >
< / div >
< div class = "portal" id = 'xowa-portal-home' >
< h3 > XOWA< / h3 >
< div class = "body" >
< ul >
< li > < a href = "http://xowa.org/index.html" title = 'Visit the main page' > Main page< / a > < / li >
< li > < a href = "http://xowa.org/screenshots.html" title = 'See screenshots of XOWA' > Screenshots< / a > < / li >
2016-06-26 06:10:12 +00:00
< li > < a href = "https://www.youtube.com/watch?v=q0qbXYXEH6M" title = "See a video of XOWA Desktop in action" > Video< / a > < / li >
2016-04-17 15:48:03 +00:00
< li > < a href = "http://xowa.org/home/wiki/Help/Download_XOWA.html" title = 'Download the XOWA application' > Download XOWA< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/Dashboard/Image_databases.html" title = 'Download offline wikis and image databases' > Download wikis< / a > < / li >
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-started' >
< h3 > Getting started< / h3 >
< div class = "body" >
< ul >
< li > < a href = "http://xowa.org/home/wiki/App/Setup/System_requirements.html" title = 'Get XOWA's system requirements' > Requirements< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/App/Setup/Installation.html" title = 'Get instructions for installing XOWA' > Installation< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title = 'Learn how to set up Simple Wikipedia' > Simple Wikipedia< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title = 'Learn how to set up English Wikipedia' > English Wikipedia< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/App/Import/Other_wikis.html" title = 'Learn how to set up other Wikipedias' > Other Wikipedias< / a > < / li >
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-android' >
< h3 > Android< / h3 >
< div class = "body" >
< ul >
< li > < a href = "http://xowa.org/home/wiki/Android/Setup.html" title = 'Setup XOWA on your Android device' > Setup< / a > < / li >
2016-06-26 06:10:12 +00:00
< li > < a href = "https://www.youtube.com/watch?v=jsMTBxGweUw" title = "See a video of XOWA Android in action" > Video< / a > < / li >
2016-04-17 15:48:03 +00:00
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-help' >
< h3 > Help< / h3 >
< div class = "body" >
< ul >
< li > < a href = "http://xowa.org/home/wiki/Help/About.html" title = 'Get more information about XOWA' > About< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/Help/Contents.html" title = 'View a list of help topics' > Contents< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/Help/Media.html" title = 'Read what others have written about XOWA' > Media< / a > < / li >
< li > < a href = "http://xowa.org/home/wiki/Help/Feedback.html" title = 'Questions? Comments? Leave feedback for XOWA' > Feedback< / a > < / li >
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-blog' >
< h3 > Blog< / h3 >
< div class = "body" >
< ul >
< li > < a href = "http://xowa.org/home/wiki/Blog.html" title = 'Follow XOWA' ' s development process ' > Current< / a > < / li >
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-links' >
< h3 > Links< / h3 >
< div class = "body" >
< ul >
< li > < a href = "http://dumps.wikimedia.org/backup-index.html" title = "Get wiki datababase dumps directly from Wikimedia" > Wikimedia dumps< / a > < / li >
< li > < a href = "https://archive.org/search.php?query=xowa" title = "Search archive.org for XOWA files" > XOWA @ archive.org< / a > < / li >
< li > < a href = "http://en.wikipedia.org" title = "Visit Wikipedia (and compare to XOWA!)" > English Wikipedia< / a > < / li >
< / ul >
< / div >
< / div >
< div class = "portal" id = 'xowa-portal-donate' >
< h3 > Donate< / h3 >
< div class = "body" >
< ul >
< li > < a href = "https://archive.org/donate/index.php" title = "Support archive.org!" > archive.org< / a > < / li > <!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning - center - fire - please - help - rebuild/ -->
< li > < a href = "https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title = "Support Wikipedia!" > Wikipedia< / a > < / li >
<!-- <li><a href="" title="Support XOWA! (but only after you've supported archive.org and Wikipedia)">XOWA</a></li> -->
< / ul >
< / div >
< / div >
2016-04-17 18:00:49 +00:00
2016-04-17 15:48:03 +00:00
< / div >
< / body >
< / html >