1
0

All.html 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886
  1. <!DOCTYPE html>
  2. <html dir="ltr">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  5. <title>Diagnostics/Scribunto/All - XOWA</title>
  6. <link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
  7. <link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
  8. </head>
  9. <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
  10. <div id="mw-page-base" class="noprint"></div>
  11. <div id="mw-head-base" class="noprint"></div>
  12. <div id="content" class="mw-body">
  13. <h1 id="firstHeading" class="firstHeading"><span>Diagnostics/Scribunto/All</span></h1>
  14. <div id="bodyContent" class="mw-body-content">
  15. <div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
  16. <div id="contentSub"></div>
  17. <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
  18. <ul>
  19. <li>
  20. Note: This is not a comprehensive testing of all functions. (i.e.: there are some working functions that are not listed below)
  21. </li>
  22. </ul>
  23. <h2>
  24. <span class="mw-headline" id="Basic">Basic</span>
  25. </h2>
  26. <ul>
  27. <li>
  28. Calls code in <a href="/wiki/Module:Diagnostics/Basic" id="xolnki_2" title="Module:Diagnostics/Basic">Module:Diagnostics/Basic</a>
  29. </li>
  30. <li>
  31. Tests basic Scribunto functionality
  32. </li>
  33. </ul>
  34. <table class="wikitable">
  35. <tr>
  36. <th>
  37. name
  38. </th>
  39. <th>
  40. code
  41. </th>
  42. <th>
  43. actl
  44. </th>
  45. <th>
  46. rslt
  47. </th>
  48. </tr>
  49. <tr>
  50. <td>
  51. <span style='color: green;'>pass</span>
  52. </td>
  53. <td>
  54. Init; Load; executeFunctionChunk
  55. </td>
  56. <td>
  57. {{#invoke:Diagnostics/Basic|print}}
  58. </td>
  59. <td>
  60. print
  61. <p>
  62. <br>
  63. </p>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td>
  68. <span style='color: green;'>pass</span>
  69. </td>
  70. <td>
  71. new line behavior
  72. </td>
  73. <td>
  74. {{#invoke:Diagnostics/Basic|new_line}}
  75. </td>
  76. <td>
  77. a
  78. <p>
  79. b
  80. </p>
  81. <p>
  82. <br>
  83. </p>
  84. </td>
  85. </tr>
  86. </table>
  87. <h2>
  88. <span class="mw-headline" id="Lua_Common">Lua Common</span>
  89. </h2>
  90. <ul>
  91. <li>
  92. Calls code in
  93. <ul>
  94. <li>
  95. <a href="/wiki/Module:Diagnostics/LuaCommon" id="xolnki_3" title="Module:Diagnostics/LuaCommon">Module:Diagnostics/LuaCommon</a>
  96. </li>
  97. <li>
  98. <a href="/wiki/Template:Diagnostics/LuaCommon/getFrameTitle_parent" id="xolnki_4" title="Template:Diagnostics/LuaCommon/getFrameTitle parent">Template:Diagnostics/LuaCommon/getFrameTitle parent</a>
  99. </li>
  100. <li>
  101. <a href="/wiki/Template:Diagnostics/LuaCommon/preprocess_args_parent" id="xolnki_5" title="Template:Diagnostics/LuaCommon/preprocess args parent">Template:Diagnostics/LuaCommon/preprocess args parent</a>
  102. </li>
  103. </ul>
  104. </li>
  105. <li>
  106. Tests compatibility for <b>LuaCommon.php</b> and <b>mw.lua</b>
  107. </li>
  108. </ul>
  109. <table class="wikitable">
  110. <tr>
  111. <th>
  112. name
  113. </th>
  114. <th>
  115. code
  116. </th>
  117. <th>
  118. actl
  119. </th>
  120. <th>
  121. rslt
  122. </th>
  123. </tr>
  124. <tr>
  125. <td>
  126. <span style='color: green;'>pass</span>
  127. </td>
  128. <td>
  129. getExpandedArgument
  130. </td>
  131. <td>
  132. {{#invoke:Diagnostics/LuaCommon|getExpandedArgument_number_2 |val_1|val_2}}
  133. </td>
  134. <td>
  135. arg_1 is 'val_1'; arg_2 is 'val_2'
  136. <p>
  137. <br>
  138. </p>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td>
  143. <span style='color: green;'>pass</span>
  144. </td>
  145. <td>
  146. getExpandedArgument_byOrdinal
  147. </td>
  148. <td>
  149. {{#invoke:Diagnostics/LuaCommon|getExpandedArgument_by_ordinal |key_1=val_1|val_2}}
  150. </td>
  151. <td>
  152. [1] is 'val_2'
  153. <p>
  154. <br>
  155. </p>
  156. </td>
  157. </tr>
  158. <tr>
  159. <td>
  160. <span style='color: green;'>pass</span>
  161. </td>
  162. <td>
  163. getAllExpandedArguments
  164. </td>
  165. <td>
  166. {{#invoke:Diagnostics/LuaCommon|getAllExpandedArguments |val_1|val_2|val_3}}
  167. </td>
  168. <td>
  169. 1:val_1;2:val_2;3:val_3;
  170. <p>
  171. <br>
  172. </p>
  173. </td>
  174. </tr>
  175. <tr>
  176. <td>
  177. <span style='color: green;'>pass</span>
  178. </td>
  179. <td>
  180. getAllExpandedArgs;key_is_int
  181. </td>
  182. <td>
  183. {{#invoke:Diagnostics/LuaCommon|getAllExpandedArguments_int_key|1=a}}
  184. </td>
  185. <td>
  186. a
  187. <p>
  188. <br>
  189. </p>
  190. </td>
  191. </tr>
  192. <tr>
  193. <td>
  194. <span style='color: green;'>pass</span>
  195. </td>
  196. <td>
  197. preprocess;redundant_keys
  198. </td>
  199. <td>
  200. {{#invoke:Diagnostics/LuaCommon|preprocess_ifeq_as_yn |val_1|val_1|when_true_val=y1|when_false_val=n1|when_true_val=y2}}
  201. </td>
  202. <td>
  203. y2
  204. <p>
  205. <br>
  206. </p>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td>
  211. <span style='color: green;'>pass</span>
  212. </td>
  213. <td>
  214. expandTemplate
  215. </td>
  216. <td>
  217. {{#invoke:Diagnostics/LuaCommon|expandTemplate|val_1|val_2}}
  218. </td>
  219. <td>
  220. arg_1 is val_1; arg_2 is val_2
  221. <p>
  222. <br>
  223. </p>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td>
  228. <span style='color: green;'>pass</span>
  229. </td>
  230. <td>
  231. expandTemplate; PHP bool; true -&gt; 1 false -&gt; ""
  232. </td>
  233. <td>
  234. {{#invoke:Diagnostics/LuaCommon|expandTemplate_bool}}
  235. </td>
  236. <td>
  237. bool_true is "1"; bool_false is "";
  238. <p>
  239. <br>
  240. </p>
  241. </td>
  242. </tr>
  243. <tr>
  244. <td>
  245. <span style='color: green;'>pass</span>
  246. </td>
  247. <td>
  248. callParserFunction
  249. </td>
  250. <td>
  251. {{#invoke:Diagnostics/LuaCommon|callParserFunction|urlencode|abc}}
  252. </td>
  253. <td>
  254. abc
  255. <p>
  256. <br>
  257. </p>
  258. </td>
  259. </tr>
  260. <tr>
  261. <td>
  262. <span style='color: green;'>pass</span>
  263. </td>
  264. <td>
  265. isSubsting;false
  266. </td>
  267. <td>
  268. {{#invoke:Diagnostics/LuaCommon|isSubsting}}
  269. </td>
  270. <td>
  271. false
  272. <p>
  273. <br>
  274. </p>
  275. </td>
  276. </tr>
  277. <tr>
  278. <td>
  279. <span style='color: green;'>pass</span>
  280. </td>
  281. <td>
  282. isSubsting;true
  283. </td>
  284. <td>
  285. {{safesubst:#invoke:Diagnostics/LuaCommon|isSubsting}}
  286. </td>
  287. <td>
  288. true
  289. <p>
  290. <br>
  291. </p>
  292. </td>
  293. </tr>
  294. <tr>
  295. <td>
  296. <span style='color: green;'>pass</span>
  297. </td>
  298. <td>
  299. getFrameTitle_current
  300. </td>
  301. <td>
  302. {{#invoke:Diagnostics/LuaCommon|getFrameTitle_current}}
  303. </td>
  304. <td>
  305. Module:Diagnostics/LuaCommon
  306. <p>
  307. <br>
  308. </p>
  309. </td>
  310. </tr>
  311. <tr>
  312. <td>
  313. <span style='color: green;'>pass</span>
  314. </td>
  315. <td>
  316. getFrameTitle_parent
  317. </td>
  318. <td>
  319. {{Diagnostics/LuaCommon/getFrameTitle_parent}}
  320. </td>
  321. <td>
  322. Template:Diagnostics/LuaCommon/getFrameTitle parent
  323. <p>
  324. <br>
  325. </p>
  326. </td>
  327. </tr>
  328. <tr>
  329. <td>
  330. <span style='color: green;'>pass</span>
  331. </td>
  332. <td>
  333. getFrameTitle_parent.upper
  334. </td>
  335. <td>
  336. {{diagnostics/LuaCommon/getFrameTitle_parent}}
  337. </td>
  338. <td>
  339. Template:Diagnostics/LuaCommon/getFrameTitle parent
  340. <p>
  341. <br>
  342. </p>
  343. </td>
  344. </tr>
  345. <tr>
  346. <td>
  347. <span style='color: green;'>pass</span>
  348. </td>
  349. <td>
  350. newChildFrame.title
  351. </td>
  352. <td>
  353. {{#invoke:Diagnostics/LuaCommon|newChildFrame_titled}}
  354. </td>
  355. <td>
  356. title:Title0; arg1:v1
  357. <p>
  358. <br>
  359. </p>
  360. </td>
  361. </tr>
  362. <tr>
  363. <td>
  364. <span style='color: green;'>pass</span>
  365. </td>
  366. <td>
  367. newChildFrame.title
  368. </td>
  369. <td>
  370. {{#invoke:Diagnostics/LuaCommon|newChildFrame_untitled}}
  371. </td>
  372. <td>
  373. title:Module:Diagnostics/LuaCommon; arg1:v1
  374. <p>
  375. <br>
  376. </p>
  377. </td>
  378. </tr>
  379. <tr>
  380. <td>
  381. <span style='color: green;'>pass</span>
  382. </td>
  383. <td>
  384. preprocess_args;frame is current
  385. </td>
  386. <td>
  387. {{#invoke:Diagnostics/LuaCommon|preprocess_args_current|match|y|n}}
  388. </td>
  389. <td>
  390. y
  391. <p>
  392. <br>
  393. </p>
  394. </td>
  395. </tr>
  396. <tr>
  397. <td>
  398. <span style='color: green;'>pass</span>
  399. </td>
  400. <td>
  401. preprocess_args;frame is parent
  402. </td>
  403. <td>
  404. {{Diagnostics/LuaCommon/preprocess_args_parent|match|y|n}}
  405. </td>
  406. <td>
  407. y
  408. <p>
  409. <br>
  410. </p>
  411. </td>
  412. </tr>
  413. <tr>
  414. <td>
  415. <span style='color: green;'>pass</span>
  416. </td>
  417. <td>
  418. preprocess calling Module functions should not call them twice; fails if onceonce
  419. </td>
  420. <td>
  421. {{#invoke:Diagnostics/LuaCommon|preprocess_nested_main}}
  422. </td>
  423. <td>
  424. once
  425. <p>
  426. <br>
  427. </p>
  428. </td>
  429. </tr>
  430. </table>
  431. <h2>
  432. <span class="mw-headline" id="Ustring_Library">Ustring Library</span>
  433. </h2>
  434. <ul>
  435. <li>
  436. Calls code in <a href="/wiki/Module:Diagnostics/UstringLibrary" id="xolnki_6" title="Module:Diagnostics/UstringLibrary">Module:Diagnostics/UstringLibrary</a>
  437. </li>
  438. <li>
  439. Tests compatibility for <b>UstringLibrary.php</b> and <b>mw.ustring.lua</b>
  440. </li>
  441. </ul>
  442. <table class="wikitable">
  443. <tr>
  444. <th>
  445. name
  446. </th>
  447. <th>
  448. code
  449. </th>
  450. <th>
  451. actl
  452. </th>
  453. <th>
  454. rslt
  455. </th>
  456. </tr>
  457. <tr>
  458. <td>
  459. <span style='color: green;'>pass</span>
  460. </td>
  461. <td>
  462. match (via trim)
  463. </td>
  464. <td>
  465. {{#invoke:Diagnostics/UstringLibrary|match| a b c |^%s*(.-)%s*$}}
  466. </td>
  467. <td>
  468. a b c
  469. <p>
  470. <br>
  471. </p>
  472. </td>
  473. </tr>
  474. <tr>
  475. <td>
  476. <span style='color: green;'>pass</span>
  477. </td>
  478. <td>
  479. match error; only regx passed
  480. </td>
  481. <td>
  482. {{#invoke:Diagnostics/UstringLibrary|match_error__regx_only}}
  483. </td>
  484. <td>
  485. <p>
  486. <br>
  487. </p>
  488. </td>
  489. </tr>
  490. <tr>
  491. <td>
  492. <span style='color: green;'>pass</span>
  493. </td>
  494. <td>
  495. gsub;replacement is string
  496. </td>
  497. <td>
  498. {{#invoke:Diagnostics/UstringLibrary|gsub_string|abcabc|[a]|A}}
  499. </td>
  500. <td>
  501. AbcAbc
  502. <p>
  503. <br>
  504. </p>
  505. </td>
  506. </tr>
  507. <tr>
  508. <td>
  509. <span style='color: green;'>pass</span>
  510. </td>
  511. <td>
  512. gsub;replacement is table
  513. </td>
  514. <td>
  515. {{#invoke:Diagnostics/UstringLibrary|gsub_table}}
  516. </td>
  517. <td>
  518. AbCAbC
  519. <p>
  520. <br>
  521. </p>
  522. </td>
  523. </tr>
  524. <tr>
  525. <td>
  526. <span style='color: green;'>pass</span>
  527. </td>
  528. <td>
  529. gsub;replacement is function (lua); basic
  530. </td>
  531. <td>
  532. {{#invoke:Diagnostics/UstringLibrary|gsub_function_lua_basic}}
  533. </td>
  534. <td>
  535. AbcAbc
  536. <p>
  537. <br>
  538. </p>
  539. </td>
  540. </tr>
  541. <tr>
  542. <td>
  543. <span style='color: green;'>pass</span>
  544. </td>
  545. <td>
  546. gsub;replacement is function (lua); grouping
  547. </td>
  548. <td>
  549. {{#invoke:Diagnostics/UstringLibrary|gsub_function_lua_grouping}}
  550. </td>
  551. <td>
  552. AbcAbc
  553. <p>
  554. <br>
  555. </p>
  556. </td>
  557. </tr>
  558. <tr>
  559. <td>
  560. <span style='color: green;'>pass</span>
  561. </td>
  562. <td>
  563. gsub;balanced group;<br>
  564. (will fail on Java 1.6, but not on Java 1.7+)
  565. </td>
  566. <td>
  567. {{#invoke:Diagnostics/UstringLibrary|gsub_string |(a)|%b()|c}}
  568. </td>
  569. <td>
  570. c
  571. <p>
  572. <br>
  573. </p>
  574. </td>
  575. </tr>
  576. <tr>
  577. <td>
  578. <span style='color: green;'>pass</span>
  579. </td>
  580. <td>
  581. gsub;regex with %W;<br>
  582. (will fail on Java 1.6, but not on Java 1.7+)
  583. </td>
  584. <td>
  585. {{#invoke:Diagnostics/UstringLibrary|gsub_string|[a]|[%W]|-}}
  586. </td>
  587. <td>
  588. -a-
  589. <p>
  590. <br>
  591. </p>
  592. </td>
  593. </tr>
  594. <tr>
  595. <td>
  596. <span style='color: green;'>pass</span>
  597. </td>
  598. <td>
  599. gmatch_init and gmatch_callback (via gmatch)
  600. </td>
  601. <td>
  602. {{#invoke:Diagnostics/UstringLibrary|gmatch|abcabc|a(b)}}
  603. </td>
  604. <td>
  605. b,;b,;
  606. <p>
  607. <br>
  608. </p>
  609. </td>
  610. </tr>
  611. <tr>
  612. <td>
  613. <span style='color: green;'>pass</span>
  614. </td>
  615. <td>
  616. gsub; non-ASCII<br>
  617. (will print unrecognizable character)
  618. </td>
  619. <td>
  620. {{#invoke:Diagnostics/UstringLibrary|gsub_string|bß|[a]ß|c}}
  621. </td>
  622. <td>
  623. <p>
  624. <br>
  625. </p>
  626. </td>
  627. </tr>
  628. </table>
  629. <h2>
  630. <span class="mw-headline" id="Uri_Library">Uri Library</span>
  631. </h2>
  632. <ul>
  633. <li>
  634. Calls code in <a href="/wiki/Module:Diagnostics/UriLibrary" id="xolnki_7" title="Module:Diagnostics/UriLibrary">Module:Diagnostics/UriLibrary</a>
  635. </li>
  636. <li>
  637. Tests compatibility for <b>UriLibrary.php</b> and <b>mw.uri.lua</b>
  638. </li>
  639. </ul>
  640. <table class="wikitable">
  641. <tr>
  642. <th>
  643. name
  644. </th>
  645. <th>
  646. code
  647. </th>
  648. <th>
  649. actl
  650. </th>
  651. <th>
  652. rslt
  653. </th>
  654. </tr>
  655. <tr>
  656. <td>
  657. <span style='color: green;'>pass</span>
  658. </td>
  659. <td>
  660. anchorEncode
  661. </td>
  662. <td>
  663. {{#invoke:Diagnostics/UriLibrary|anchorEncode|[irc://a b c]}}
  664. </td>
  665. <td>
  666. b_c
  667. <p>
  668. <br>
  669. </p>
  670. </td>
  671. </tr>
  672. <tr>
  673. <td>
  674. <span style='color: green;'>pass</span>
  675. </td>
  676. <td>
  677. localUrl
  678. </td>
  679. <td>
  680. {{#invoke:Diagnostics/UriLibrary|localUrl|a&amp;b! c}}
  681. </td>
  682. <td>
  683. /wiki/A%26b!_c
  684. <p>
  685. <br>
  686. </p>
  687. </td>
  688. </tr>
  689. <tr>
  690. <td>
  691. <span style='color: green;'>pass</span>
  692. </td>
  693. <td>
  694. fullUrl
  695. </td>
  696. <td>
  697. {{#invoke:Diagnostics/UriLibrary|fullUrl|a&amp;b! c}}
  698. </td>
  699. <td>
  700. //home/wiki/A%26b!_c
  701. <p>
  702. <br>
  703. </p>
  704. </td>
  705. </tr>
  706. <tr>
  707. <td>
  708. <span style='color: green;'>pass</span>
  709. </td>
  710. <td>
  711. defaultUrl
  712. </td>
  713. <td>
  714. {{#invoke:Diagnostics/UriLibrary|defaultUrl}}
  715. </td>
  716. <td>
  717. //home/wiki/Diagnostics/Scribunto/All
  718. <p>
  719. <br>
  720. </p>
  721. </td>
  722. </tr>
  723. </table>
  724. <h2>
  725. <span class="mw-headline" id="Language_Library">Language Library</span>
  726. </h2>
  727. <ul>
  728. <li>
  729. Calls code in <a href="/wiki/Module:Diagnostics/LanguageLibrary" id="xolnki_8" title="Module:Diagnostics/LanguageLibrary">Module:Diagnostics/LanguageLibrary</a>
  730. </li>
  731. <li>
  732. Tests compatibility for <b>LanguageLibrary.php</b> and <b>mw.language.lua</b>
  733. </li>
  734. </ul>
  735. <table class="wikitable">
  736. <tr>
  737. <th>
  738. name
  739. </th>
  740. <th>
  741. code
  742. </th>
  743. <th>
  744. actl
  745. </th>
  746. <th>
  747. rslt
  748. </th>
  749. </tr>
  750. <tr>
  751. <td>
  752. <span style='color: green;'>pass</span>
  753. </td>
  754. <td>
  755. getContLangCode (by getContentLanguage)
  756. </td>
  757. <td>
  758. {{#invoke:Diagnostics/LanguageLibrary|getContLangCode}}
  759. </td>
  760. <td>
  761. en
  762. <p>
  763. <br>
  764. </p>
  765. </td>
  766. </tr>
  767. <tr>
  768. <td>
  769. <span style='color: green;'>pass</span>
  770. </td>
  771. <td>
  772. isKnownLanguageTag; true
  773. </td>
  774. <td>
  775. {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|en}}
  776. </td>
  777. <td>
  778. true
  779. <p>
  780. <br>
  781. </p>
  782. </td>
  783. </tr>
  784. <tr>
  785. <td>
  786. <span style='color: green;'>pass</span>
  787. </td>
  788. <td>
  789. isKnownLanguageTag; false
  790. </td>
  791. <td>
  792. {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|xyz}}
  793. </td>
  794. <td>
  795. false
  796. <p>
  797. <br>
  798. </p>
  799. </td>
  800. </tr>
  801. <tr>
  802. <td>
  803. <span style='color: green;'>pass</span>
  804. </td>
  805. <td>
  806. isValidCode; true
  807. </td>
  808. <td>
  809. {{#invoke:Diagnostics/LanguageLibrary|isValidCode|en}}
  810. </td>
  811. <td>
  812. true
  813. <p>
  814. <br>
  815. </p>
  816. </td>
  817. </tr>
  818. <tr>
  819. <td>
  820. <span style='color: green;'>pass</span>
  821. </td>
  822. <td>
  823. isValidCode; false
  824. </td>
  825. <td>
  826. {{#invoke:Diagnostics/LanguageLibrary|isValidCode|a[b}}
  827. </td>
  828. <td>
  829. false
  830. <p>
  831. <br>
  832. </p>
  833. </td>
  834. </tr>
  835. <tr>
  836. <td>
  837. <span style='color: green;'>pass</span>
  838. </td>
  839. <td>
  840. isValidBuiltInCode; true
  841. </td>
  842. <td>
  843. {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|en}}
  844. </td>
  845. <td>
  846. true
  847. <p>
  848. <br>
  849. </p>
  850. </td>
  851. </tr>
  852. <tr>
  853. <td>
  854. <span style='color: green;'>pass</span>
  855. </td>
  856. <td>
  857. isValidBuiltInCode; false
  858. </td>
  859. <td>
  860. {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|a#b}}
  861. </td>
  862. <td>
  863. false
  864. <p>
  865. <br>
  866. </p>
  867. </td>
  868. </tr>
  869. <tr>
  870. <td>
  871. <span style='color: green;'>pass</span>
  872. </td>
  873. <td>
  874. fetchLanguageName; code only
  875. </td>
  876. <td>
  877. {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageName|en|en}}
  878. </td>
  879. <td>
  880. English
  881. <p>
  882. <br>
  883. </p>
  884. </td>
  885. </tr>
  886. <tr>
  887. <td>
  888. <span style='color: green;'>pass</span>
  889. </td>
  890. <td>
  891. fetchLanguageNames_get
  892. </td>
  893. <td>
  894. {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageNames_get|fr}}
  895. </td>
  896. <td>
  897. français
  898. <p>
  899. <br>
  900. </p>
  901. </td>
  902. </tr>
  903. <tr>
  904. <td>
  905. <span style='color: green;'>pass</span>
  906. </td>
  907. <td>
  908. new
  909. </td>
  910. <td>
  911. {{#invoke:Diagnostics/LanguageLibrary|new_lang_code|fr}}
  912. </td>
  913. <td>
  914. fr
  915. <p>
  916. <br>
  917. </p>
  918. </td>
  919. </tr>
  920. <tr>
  921. <td>
  922. <span style='color: green;'>pass</span>
  923. </td>
  924. <td>
  925. formatNum; en
  926. </td>
  927. <td>
  928. {{#invoke:Diagnostics/LanguageLibrary|formatNum|1234}}
  929. </td>
  930. <td>
  931. 1,234
  932. <p>
  933. <br>
  934. </p>
  935. </td>
  936. </tr>
  937. <tr>
  938. <td>
  939. <span style='color: green;'>pass</span>
  940. </td>
  941. <td>
  942. parseFormatteNum; en
  943. </td>
  944. <td>
  945. {{#invoke:Diagnostics/LanguageLibrary|parseFormattedNum|1,234}}
  946. </td>
  947. <td>
  948. 1,234
  949. <p>
  950. <br>
  951. </p>
  952. </td>
  953. </tr>
  954. <tr>
  955. <td>
  956. <span style='color: green;'>pass</span>
  957. </td>
  958. <td>
  959. formatDate via pcall; y;
  960. </td>
  961. <td>
  962. {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|2014-03-25}}
  963. </td>
  964. <td>
  965. y
  966. <p>
  967. <br>
  968. </p>
  969. </td>
  970. </tr>
  971. <tr>
  972. <td>
  973. <span style='color: green;'>pass</span>
  974. </td>
  975. <td>
  976. formatDate via pcall; n;
  977. </td>
  978. <td>
  979. {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|fail}}
  980. </td>
  981. <td>
  982. n
  983. <p>
  984. <br>
  985. </p>
  986. </td>
  987. </tr>
  988. <tr>
  989. <td>
  990. <span style='color: green;'>pass</span>
  991. </td>
  992. <td>
  993. convertGrammar
  994. </td>
  995. <td>
  996. {{#invoke:Diagnostics/LanguageLibrary|convertGrammar|fi|talo|elative}}
  997. </td>
  998. <td>
  999. talosta
  1000. <p>
  1001. <br>
  1002. </p>
  1003. </td>
  1004. </tr>
  1005. <tr>
  1006. <td>
  1007. <span style='color: green;'>pass</span>
  1008. </td>
  1009. <td>
  1010. isRTL; en
  1011. </td>
  1012. <td>
  1013. {{#invoke:Diagnostics/LanguageLibrary|isRTL|en}}
  1014. </td>
  1015. <td>
  1016. false
  1017. <p>
  1018. <br>
  1019. </p>
  1020. </td>
  1021. </tr>
  1022. <tr>
  1023. <td>
  1024. <span style='color: green;'>pass</span>
  1025. </td>
  1026. <td>
  1027. isRTL; ar
  1028. </td>
  1029. <td>
  1030. {{#invoke:Diagnostics/LanguageLibrary|isRTL|ar}}
  1031. </td>
  1032. <td>
  1033. true
  1034. <p>
  1035. <br>
  1036. </p>
  1037. </td>
  1038. </tr>
  1039. <tr>
  1040. <td>
  1041. <span style='color: green;'>pass</span>
  1042. </td>
  1043. <td>
  1044. format_durations_hms
  1045. </td>
  1046. <td>
  1047. {{#invoke:Diagnostics/LanguageLibrary|format_durations_hms|123}}
  1048. </td>
  1049. <td>
  1050. 2 minutes and 3 seconds
  1051. <p>
  1052. <br>
  1053. </p>
  1054. </td>
  1055. </tr>
  1056. <tr>
  1057. <td>
  1058. <span style='color: green;'>pass</span>
  1059. </td>
  1060. <td>
  1061. get_duration_intervals_hms
  1062. </td>
  1063. <td>
  1064. {{#invoke:Diagnostics/LanguageLibrary|get_duration_intervals_hms|123}}
  1065. </td>
  1066. <td>
  1067. ,2,3
  1068. <p>
  1069. <br>
  1070. </p>
  1071. </td>
  1072. </tr>
  1073. </table>
  1074. <h2>
  1075. <span class="mw-headline" id="Site_Library">Site Library</span>
  1076. </h2>
  1077. <ul>
  1078. <li>
  1079. Calls code in <a href="/wiki/Module:Diagnostics/SiteLibrary" id="xolnki_9" title="Module:Diagnostics/SiteLibrary">Module:Diagnostics/SiteLibrary</a>
  1080. </li>
  1081. <li>
  1082. Tests compatibility for <b>SiteLibrary.php</b> and <b>mw.site.lua</b>
  1083. </li>
  1084. </ul>
  1085. <table class="wikitable">
  1086. <tr>
  1087. <th>
  1088. name
  1089. </th>
  1090. <th>
  1091. code
  1092. </th>
  1093. <th>
  1094. actl
  1095. </th>
  1096. <th>
  1097. rslt
  1098. </th>
  1099. </tr>
  1100. <tr>
  1101. <td>
  1102. <span style='color: green;'>pass</span>
  1103. </td>
  1104. <td>
  1105. siteName
  1106. </td>
  1107. <td>
  1108. {{#invoke:Diagnostics/SiteLibrary|siteName}}
  1109. </td>
  1110. <td>
  1111. home
  1112. <p>
  1113. <br>
  1114. </p>
  1115. </td>
  1116. </tr>
  1117. <tr>
  1118. <td>
  1119. <span style='color: green;'>pass</span>
  1120. </td>
  1121. <td>
  1122. ns_name
  1123. </td>
  1124. <td>
  1125. {{#invoke:Diagnostics/SiteLibrary|ns_associated|Help}}
  1126. </td>
  1127. <td>
  1128. Help talk
  1129. <p>
  1130. <br>
  1131. </p>
  1132. </td>
  1133. </tr>
  1134. </table>
  1135. <h2>
  1136. <span class="mw-headline" id="Title_Library">Title Library</span>
  1137. </h2>
  1138. <ul>
  1139. <li>
  1140. Calls code in <a href="/wiki/Module:Diagnostics/TitleLibrary" id="xolnki_10" title="Module:Diagnostics/TitleLibrary">Module:Diagnostics/TitleLibrary</a>
  1141. </li>
  1142. <li>
  1143. Tests compatibility for <b>TitleLibrary.php</b> and <b>mw.title.lua</b>
  1144. </li>
  1145. </ul>
  1146. <table class="wikitable">
  1147. <tr>
  1148. <th>
  1149. name
  1150. </th>
  1151. <th>
  1152. code
  1153. </th>
  1154. <th>
  1155. actl
  1156. </th>
  1157. <th>
  1158. rslt
  1159. </th>
  1160. </tr>
  1161. <tr>
  1162. <td>
  1163. <span style='color: green;'>pass</span>
  1164. </td>
  1165. <td>
  1166. newTitle
  1167. </td>
  1168. <td>
  1169. {{#invoke:Diagnostics/TitleLibrary|newTitle|Main_Page}}
  1170. </td>
  1171. <td>
  1172. Main Page
  1173. <p>
  1174. <br>
  1175. </p>
  1176. </td>
  1177. </tr>
  1178. <tr>
  1179. <td>
  1180. <span style='color: green;'>pass</span>
  1181. </td>
  1182. <td>
  1183. newTitle; namespace arg
  1184. </td>
  1185. <td>
  1186. {{#invoke:Diagnostics/TitleLibrary|newTitle|Contents|Help}}
  1187. </td>
  1188. <td>
  1189. Help:Contents
  1190. <p>
  1191. <br>
  1192. </p>
  1193. </td>
  1194. </tr>
  1195. <tr>
  1196. <td>
  1197. <span style='color: green;'>pass</span>
  1198. </td>
  1199. <td>
  1200. makeTitle
  1201. </td>
  1202. <td>
  1203. {{#invoke:Diagnostics/TitleLibrary|makeTitle|Help|Contents|Overview|home}}
  1204. </td>
  1205. <td>
  1206. home:Help:Contents#Overview
  1207. <p>
  1208. <br>
  1209. </p>
  1210. </td>
  1211. </tr>
  1212. <tr>
  1213. <td>
  1214. <span style='color: green;'>pass</span>
  1215. </td>
  1216. <td>
  1217. fullUrl
  1218. </td>
  1219. <td>
  1220. {{#invoke:Diagnostics/TitleLibrary|fullUrl|Help|Contents}}
  1221. </td>
  1222. <td>
  1223. //home/wiki/Help:Contents
  1224. <p>
  1225. <br>
  1226. </p>
  1227. </td>
  1228. </tr>
  1229. <tr>
  1230. <td>
  1231. <span style='color: green;'>pass</span>
  1232. </td>
  1233. <td>
  1234. getCurrentTitle
  1235. </td>
  1236. <td>
  1237. {{#invoke:Diagnostics/TitleLibrary|getCurrentTitle}}
  1238. </td>
  1239. <td>
  1240. Diagnostics/Scribunto/All
  1241. <p>
  1242. <br>
  1243. </p>
  1244. </td>
  1245. </tr>
  1246. </table>
  1247. <h2>
  1248. <span class="mw-headline" id="Text_Library">Text Library</span>
  1249. </h2>
  1250. <ul>
  1251. <li>
  1252. Calls code in <a href="/wiki/Module:Diagnostics/TextLibrary" id="xolnki_11" title="Module:Diagnostics/TextLibrary">Module:Diagnostics/TextLibrary</a>
  1253. </li>
  1254. <li>
  1255. Tests compatibility for <b>TextLibrary.php</b> and <b>mw.text.lua</b>
  1256. </li>
  1257. </ul>
  1258. <table class="wikitable">
  1259. <tr>
  1260. <th>
  1261. name
  1262. </th>
  1263. <th>
  1264. code
  1265. </th>
  1266. <th>
  1267. actl
  1268. </th>
  1269. <th>
  1270. rslt
  1271. </th>
  1272. </tr>
  1273. <tr>
  1274. <td>
  1275. <span style='color: green;'>pass</span>
  1276. </td>
  1277. <td>
  1278. init_text_for_wiki (via listToText)
  1279. </td>
  1280. <td>
  1281. {{#invoke:Diagnostics/TextLibrary|listToText|a|b|c}}
  1282. </td>
  1283. <td>
  1284. a, b and c
  1285. <p>
  1286. <br>
  1287. </p>
  1288. </td>
  1289. </tr>
  1290. <tr>
  1291. <td>
  1292. <span style='color: green;'>pass</span>
  1293. </td>
  1294. <td>
  1295. unstrip
  1296. </td>
  1297. <td>
  1298. {{#invoke:Diagnostics/TextLibrary|unstrip|abc}}
  1299. </td>
  1300. <td>
  1301. abc
  1302. <p>
  1303. <br>
  1304. </p>
  1305. </td>
  1306. </tr>
  1307. <tr>
  1308. <td>
  1309. <span style='color: green;'>pass</span>
  1310. </td>
  1311. <td>
  1312. getEntityTable (via decode)
  1313. </td>
  1314. <td>
  1315. {{#invoke:Diagnostics/TextLibrary|decode|gt;}}
  1316. </td>
  1317. <td>
  1318. &gt;
  1319. </td>
  1320. </tr>
  1321. </table>
  1322. <h2>
  1323. <span class="mw-headline" id="HTML_Library">HTML Library</span>
  1324. </h2>
  1325. <ul>
  1326. <li>
  1327. Calls code in <a href="/wiki/Module:Diagnostics/HtmlLibrary" id="xolnki_12" title="Module:Diagnostics/HtmlLibrary">Module:Diagnostics/HtmlLibrary</a>
  1328. </li>
  1329. <li>
  1330. Tests compatibility for <b>mw.html.lua</b>
  1331. </li>
  1332. </ul>
  1333. <table class="wikitable">
  1334. <tr>
  1335. <th>
  1336. name
  1337. </th>
  1338. <th>
  1339. code
  1340. </th>
  1341. <th>
  1342. actl
  1343. </th>
  1344. <th>
  1345. rslt
  1346. </th>
  1347. </tr>
  1348. <tr>
  1349. <td>
  1350. <span style='color: green;'>pass</span>
  1351. </td>
  1352. <td>
  1353. create
  1354. </td>
  1355. <td>
  1356. {{#invoke:Diagnostics/HtmlLibrary|create_span}}
  1357. </td>
  1358. <td>
  1359. span
  1360. <p>
  1361. <br>
  1362. </p>
  1363. </td>
  1364. </tr>
  1365. </table>
  1366. <h2>
  1367. <span class="mw-headline" id="Hash_Library">Hash Library</span>
  1368. </h2>
  1369. <ul>
  1370. <li>
  1371. Calls code in <a href="/wiki/Module:Diagnostics/HashLibrary" id="xolnki_13" title="Module:Diagnostics/HashLibrary">Module:Diagnostics/HashLibrary</a>
  1372. </li>
  1373. <li>
  1374. Tests compatibility for <b>mw.hash.lua</b>
  1375. </li>
  1376. </ul>
  1377. <table class="wikitable">
  1378. <tr>
  1379. <th>
  1380. name
  1381. </th>
  1382. <th>
  1383. code
  1384. </th>
  1385. <th>
  1386. actl
  1387. </th>
  1388. <th>
  1389. rslt
  1390. </th>
  1391. </tr>
  1392. <tr>
  1393. <td>
  1394. <span style='color: green;'>pass</span>
  1395. </td>
  1396. <td>
  1397. listAlgorithms
  1398. </td>
  1399. <td>
  1400. {{#invoke:Diagnostics/HashLibrary|listAlgorithms|md2|tiger128,3|adler32|fnv132|haval128,3}}
  1401. </td>
  1402. <td>
  1403. md2;tiger-128;adler32;fnv132;haval128,3;
  1404. <p>
  1405. <br>
  1406. </p>
  1407. </td>
  1408. </tr>
  1409. <tr>
  1410. <td>
  1411. <span style='color: green;'>pass</span>
  1412. </td>
  1413. <td>
  1414. hash.bouncycastle.md2
  1415. </td>
  1416. <td>
  1417. {{#invoke:Diagnostics/HashLibrary|hashValue|md2|}}
  1418. </td>
  1419. <td>
  1420. 4e8ddff3650292ab5a4108c3aa47940b
  1421. <p>
  1422. <br>
  1423. </p>
  1424. </td>
  1425. </tr>
  1426. <tr>
  1427. <td>
  1428. <span style='color: green;'>pass</span>
  1429. </td>
  1430. <td>
  1431. hash.jacksum.tiger128,3
  1432. </td>
  1433. <td>
  1434. {{#invoke:Diagnostics/HashLibrary|hashValue|tiger128,3|}}
  1435. </td>
  1436. <td>
  1437. 1714a472eee57d30040412bfcc55032a
  1438. <p>
  1439. <br>
  1440. </p>
  1441. </td>
  1442. </tr>
  1443. <tr>
  1444. <td>
  1445. <span style='color: green;'>pass</span>
  1446. </td>
  1447. <td>
  1448. hash.jre.adler32
  1449. </td>
  1450. <td>
  1451. {{#invoke:Diagnostics/HashLibrary|hashValue|adler32|}}
  1452. </td>
  1453. <td>
  1454. 90860b20
  1455. <p>
  1456. <br>
  1457. </p>
  1458. </td>
  1459. </tr>
  1460. <tr>
  1461. <td>
  1462. <span style='color: green;'>pass</span>
  1463. </td>
  1464. <td>
  1465. hash.jre.fnv132
  1466. </td>
  1467. <td>
  1468. {{#invoke:Diagnostics/HashLibrary|hashValue|fnv132|}}
  1469. </td>
  1470. <td>
  1471. 819dafd8
  1472. <p>
  1473. <br>
  1474. </p>
  1475. </td>
  1476. </tr>
  1477. <tr>
  1478. <td>
  1479. <span style='color: green;'>pass</span>
  1480. </td>
  1481. <td>
  1482. hash.gnu_crypto.haval128,3
  1483. </td>
  1484. <td>
  1485. {{#invoke:Diagnostics/HashLibrary|hashValue|haval128,3|}}
  1486. </td>
  1487. <td>
  1488. dc502247fb3eb8376109eda32d361d82
  1489. <p>
  1490. <br>
  1491. </p>
  1492. </td>
  1493. </tr>
  1494. </table>
  1495. <h2>
  1496. <span class="mw-headline" id="Message_Library">Message Library</span>
  1497. </h2>
  1498. <ul>
  1499. <li>
  1500. Calls code in <a href="/wiki/Module:Diagnostics/MessageLibrary" id="xolnki_14" title="Module:Diagnostics/MessageLibrary">Module:Diagnostics/MessageLibrary</a>
  1501. </li>
  1502. <li>
  1503. Tests compatibility for <b>MessageLibrary.php</b> and <b>mw.message.lua</b>
  1504. </li>
  1505. </ul>
  1506. <table class="wikitable">
  1507. <tr>
  1508. <th>
  1509. name
  1510. </th>
  1511. <th>
  1512. code
  1513. </th>
  1514. <th>
  1515. actl
  1516. </th>
  1517. <th>
  1518. rslt
  1519. </th>
  1520. </tr>
  1521. <tr>
  1522. <td>
  1523. <span style='color: green;'>pass</span>
  1524. </td>
  1525. <td>
  1526. init_message_for_lang (via getDefaultLanguage)
  1527. </td>
  1528. <td>
  1529. {{#invoke:Diagnostics/MessageLibrary|getDefaultLanguage}}
  1530. </td>
  1531. <td>
  1532. en
  1533. <p>
  1534. <br>
  1535. </p>
  1536. </td>
  1537. </tr>
  1538. <tr>
  1539. <td>
  1540. <span style='color: green;'>pass</span>
  1541. </td>
  1542. <td>
  1543. plain
  1544. </td>
  1545. <td>
  1546. {{#invoke:Diagnostics/MessageLibrary|plain|mainpage}}
  1547. </td>
  1548. <td>
  1549. Main Page
  1550. <p>
  1551. <br>
  1552. </p>
  1553. </td>
  1554. </tr>
  1555. <tr>
  1556. <td>
  1557. <span style='color: green;'>pass</span>
  1558. </td>
  1559. <td>
  1560. plain; params
  1561. </td>
  1562. <td>
  1563. {{#invoke:Diagnostics/MessageLibrary|plain|redirectedfrom|A}}
  1564. </td>
  1565. <td>
  1566. (Redirected from A)
  1567. <p>
  1568. <br>
  1569. </p>
  1570. </td>
  1571. </tr>
  1572. <tr>
  1573. <td>
  1574. <span style='color: green;'>pass</span>
  1575. </td>
  1576. <td>
  1577. exists; true
  1578. </td>
  1579. <td>
  1580. {{#invoke:Diagnostics/MessageLibrary|check|exists|sun}}
  1581. </td>
  1582. <td>
  1583. true
  1584. <p>
  1585. <br>
  1586. </p>
  1587. </td>
  1588. </tr>
  1589. <tr>
  1590. <td>
  1591. <span style='color: green;'>pass</span>
  1592. </td>
  1593. <td>
  1594. exists; false
  1595. </td>
  1596. <td>
  1597. {{#invoke:Diagnostics/MessageLibrary|check|exists|sunx}}
  1598. </td>
  1599. <td>
  1600. false
  1601. <p>
  1602. <br>
  1603. </p>
  1604. </td>
  1605. </tr>
  1606. <tr>
  1607. <td>
  1608. <span style='color: green;'>pass</span>
  1609. </td>
  1610. <td>
  1611. isBlank; false
  1612. </td>
  1613. <td>
  1614. {{#invoke:Diagnostics/MessageLibrary|check|isBlank|sun}}
  1615. </td>
  1616. <td>
  1617. false
  1618. <p>
  1619. <br>
  1620. </p>
  1621. </td>
  1622. </tr>
  1623. <tr>
  1624. <td>
  1625. <span style='color: green;'>pass</span>
  1626. </td>
  1627. <td>
  1628. isDisabled; false
  1629. </td>
  1630. <td>
  1631. {{#invoke:Diagnostics/MessageLibrary|check|isDisabled|sun}}
  1632. </td>
  1633. <td>
  1634. false
  1635. <p>
  1636. <br>
  1637. </p>
  1638. </td>
  1639. </tr>
  1640. <tr>
  1641. <td>
  1642. <span style='color: green;'>pass</span>
  1643. </td>
  1644. <td>
  1645. inLanguage
  1646. </td>
  1647. <td>
  1648. {{#invoke:Diagnostics/MessageLibrary|plain_inLanguage|fr|sun}}
  1649. </td>
  1650. <td>
  1651. Dim.
  1652. <p>
  1653. <br>
  1654. </p>
  1655. </td>
  1656. </tr>
  1657. <tr>
  1658. <td>
  1659. <span style='color: green;'>pass</span>
  1660. </td>
  1661. <td>
  1662. rawMessage_toString
  1663. </td>
  1664. <td>
  1665. {{#invoke:Diagnostics/MessageLibrary|plain_rawMessage|a$1c|b}}
  1666. </td>
  1667. <td>
  1668. abc
  1669. <p>
  1670. <br>
  1671. </p>
  1672. </td>
  1673. </tr>
  1674. </table>
  1675. <h2>
  1676. <span class="mw-headline" id="Wikibase_Library">Wikibase Library</span>
  1677. </h2>
  1678. <ul>
  1679. <li>
  1680. Wikidata needs to be installed for these tests to work
  1681. </li>
  1682. <li>
  1683. Calls code in <a href="/wiki/Module:Diagnostics/WikibaseLibrary" id="xolnki_15" title="Module:Diagnostics/WikibaseLibrary">Module:Diagnostics/WikibaseLibrary</a>
  1684. </li>
  1685. <li>
  1686. Tests compatibility for <b>WikibaseLibrary.php</b> and <b>mw.wikibase.lua</b>
  1687. </li>
  1688. </ul>
  1689. <table class="wikitable">
  1690. <tr>
  1691. <th>
  1692. name
  1693. </th>
  1694. <th>
  1695. code
  1696. </th>
  1697. <th>
  1698. actl
  1699. </th>
  1700. <th>
  1701. rslt
  1702. </th>
  1703. </tr>
  1704. <tr>
  1705. <td>
  1706. <span style='color: red;'>fail:<br>
  1707. '</span>
  1708. <pre>
  1709. <span style='color: red;'>'<br>
  1710. 'Earth
  1711. '</span>
  1712. </pre>
  1713. </td>
  1714. <td>
  1715. getEntity
  1716. </td>
  1717. <td>
  1718. {{#invoke:Diagnostics/WikibaseLibrary|label|q2}}
  1719. </td>
  1720. <td>
  1721. <p>
  1722. <br>
  1723. </p>
  1724. </td>
  1725. </tr>
  1726. </table>
  1727. <p>
  1728. <br>
  1729. </p>
  1730. <h2>
  1731. <span class="mw-headline" id="Luaj">Luaj</span>
  1732. </h2>
  1733. <ul>
  1734. <li>
  1735. Applies to the Luaj engine (as opposed to the Lua engine)
  1736. </li>
  1737. <li>
  1738. Calls code in <a href="/wiki/Module:Diagnostics/Luaj" id="xolnki_16" title="Module:Diagnostics/Luaj">Module:Diagnostics/Luaj</a>
  1739. </li>
  1740. <li>
  1741. Tests changes to the luaj_xowa.jar
  1742. </li>
  1743. <li>
  1744. Further notes available at <a href="/wiki/App/Xtn/Mediawiki/Scribunto/Luaj" id="xolnki_17" title="App/Xtn/Mediawiki/Scribunto/Luaj">App/Xtn/Mediawiki/Scribunto/Luaj</a>
  1745. </li>
  1746. </ul>
  1747. <h3>
  1748. <span class="mw-headline" id="2.0.3_errors_fixed_in_3.0">2.0.3 errors fixed in 3.0</span>
  1749. </h3>
  1750. <table class="wikitable">
  1751. <tr>
  1752. <th>
  1753. name
  1754. </th>
  1755. <th>
  1756. code
  1757. </th>
  1758. <th>
  1759. actl
  1760. </th>
  1761. <th>
  1762. rslt
  1763. </th>
  1764. </tr>
  1765. <tr>
  1766. <td>
  1767. <span style='color: green;'>pass</span>
  1768. </td>
  1769. <td>
  1770. string.format fails for bad format; fails with ""
  1771. </td>
  1772. <td>
  1773. {{#invoke:Diagnostics/Luaj|string_format_2|%d:%02.f|3|4}}
  1774. </td>
  1775. <td>
  1776. 3:04
  1777. <p>
  1778. <br>
  1779. </p>
  1780. </td>
  1781. </tr>
  1782. <tr>
  1783. <td>
  1784. <span style='color: green;'>pass</span>
  1785. </td>
  1786. <td>
  1787. os.time does not handle dates before 1970 on Windows; fails with false on Windows<br>
  1788. NOTE: always fails on Windows with the lua engine
  1789. </td>
  1790. <td>
  1791. {{#invoke:Diagnostics/Luaj|os_time|1234|05|06}}
  1792. </td>
  1793. <td>
  1794. true
  1795. <p>
  1796. <br>
  1797. </p>
  1798. </td>
  1799. </tr>
  1800. <tr>
  1801. <td>
  1802. <span style='color: green;'>pass</span>
  1803. </td>
  1804. <td>
  1805. pairs.next fails when setting val to null; fails with ""
  1806. </td>
  1807. <td>
  1808. {{#invoke:Diagnostics/Luaj|pairs_next}}
  1809. </td>
  1810. <td>
  1811. ok
  1812. <p>
  1813. <br>
  1814. </p>
  1815. </td>
  1816. </tr>
  1817. </table>
  1818. <h3>
  1819. <span class="mw-headline" id="2.0.3_features_removed_from_3.0">2.0.3 features removed from 3.0</span>
  1820. </h3>
  1821. <table class="wikitable">
  1822. <tr>
  1823. <th>
  1824. name
  1825. </th>
  1826. <th>
  1827. code
  1828. </th>
  1829. <th>
  1830. actl
  1831. </th>
  1832. <th>
  1833. rslt
  1834. </th>
  1835. </tr>
  1836. <tr>
  1837. <td>
  1838. <span style='color: green;'>pass</span>
  1839. </td>
  1840. <td>
  1841. string.gfind deprecated; should be alias to gmatch; fails with ""
  1842. </td>
  1843. <td>
  1844. {{#invoke:Diagnostics/Luaj|string_gfind|ab cd|%w+}}
  1845. </td>
  1846. <td>
  1847. ab
  1848. <p>
  1849. <br>
  1850. </p>
  1851. </td>
  1852. </tr>
  1853. <tr>
  1854. <td>
  1855. <span style='color: green;'>pass</span>
  1856. </td>
  1857. <td>
  1858. tonumber returns original value if value has decimal and base is 10; fails with ""
  1859. </td>
  1860. <td>
  1861. {{#invoke:Diagnostics/Luaj|tonumber|12.34|10}}
  1862. </td>
  1863. <td>
  1864. 12.34
  1865. <p>
  1866. <br>
  1867. </p>
  1868. </td>
  1869. </tr>
  1870. <tr>
  1871. <td>
  1872. <span style='color: green;'>pass</span>
  1873. </td>
  1874. <td>
  1875. tonumber('-') should be nil not 0
  1876. </td>
  1877. <td>
  1878. {{#invoke:Diagnostics/Luaj|tonumber_lone|-}}
  1879. </td>
  1880. <td>
  1881. <p>
  1882. <br>
  1883. </p>
  1884. </td>
  1885. </tr>
  1886. <tr>
  1887. <td>
  1888. <span style='color: green;'>pass</span>
  1889. </td>
  1890. <td>
  1891. math.log10 deprecated; now calls Math.log10; fails with ""
  1892. </td>
  1893. <td>
  1894. {{#invoke:Diagnostics/Luaj|math_log10|100}}
  1895. </td>
  1896. <td>
  1897. 2
  1898. <p>
  1899. <br>
  1900. </p>
  1901. </td>
  1902. </tr>
  1903. <tr>
  1904. <td>
  1905. <span style='color: green;'>pass</span>
  1906. </td>
  1907. <td>
  1908. math.mod deprecated; now aliased to math.fmod; fails with ""
  1909. </td>
  1910. <td>
  1911. {{#invoke:Diagnostics/Luaj|math_mod|3|2}}
  1912. </td>
  1913. <td>
  1914. 1
  1915. <p>
  1916. <br>
  1917. </p>
  1918. </td>
  1919. </tr>
  1920. <tr>
  1921. <td>
  1922. <span style='color: green;'>pass</span>
  1923. </td>
  1924. <td>
  1925. table.maxn deprecated; fails with ""
  1926. </td>
  1927. <td>
  1928. {{#invoke:Diagnostics/Luaj|table_maxn}}
  1929. </td>
  1930. <td>
  1931. 3
  1932. <p>
  1933. <br>
  1934. </p>
  1935. </td>
  1936. </tr>
  1937. <tr>
  1938. <td>
  1939. <span style='color: green;'>pass</span>
  1940. </td>
  1941. <td>
  1942. table.getn deprecated -- key_is_num; fails with ""
  1943. </td>
  1944. <td>
  1945. {{#invoke:Diagnostics/Luaj|table_getn__key_is_num}}
  1946. </td>
  1947. <td>
  1948. 3
  1949. <p>
  1950. <br>
  1951. </p>
  1952. </td>
  1953. </tr>
  1954. <tr>
  1955. <td>
  1956. <span style='color: green;'>pass</span>
  1957. </td>
  1958. <td>
  1959. table.getn deprecated -- key_is_str; fails with ""
  1960. </td>
  1961. <td>
  1962. {{#invoke:Diagnostics/Luaj|table_getn__key_is_str}}
  1963. </td>
  1964. <td>
  1965. 0
  1966. <p>
  1967. <br>
  1968. </p>
  1969. </td>
  1970. </tr>
  1971. <tr>
  1972. <td>
  1973. <span style='color: green;'>pass</span>
  1974. </td>
  1975. <td>
  1976. automatic arg variable in varargs function deprecated; fails with ""
  1977. </td>
  1978. <td>
  1979. {{#invoke:Diagnostics/Luaj|varargs_arg}}
  1980. </td>
  1981. <td>
  1982. a
  1983. <p>
  1984. <br>
  1985. </p>
  1986. </td>
  1987. </tr>
  1988. </table>
  1989. <h3>
  1990. <span class="mw-headline" id="3.0_defects">3.0 defects</span>
  1991. </h3>
  1992. <table class="wikitable">
  1993. <tr>
  1994. <th>
  1995. name
  1996. </th>
  1997. <th>
  1998. code
  1999. </th>
  2000. <th>
  2001. actl
  2002. </th>
  2003. <th>
  2004. rslt
  2005. </th>
  2006. </tr>
  2007. <tr>
  2008. <td>
  2009. <span style='color: green;'>pass</span>
  2010. </td>
  2011. <td>
  2012. tonumber should trim all white space, not just \s; fails with ""
  2013. </td>
  2014. <td>
  2015. {{#invoke:Diagnostics/Luaj|value_tonumber_trim}}
  2016. </td>
  2017. <td>
  2018. 123
  2019. <p>
  2020. <br>
  2021. </p>
  2022. </td>
  2023. </tr>
  2024. <tr>
  2025. <td>
  2026. <span style='color: green;'>pass</span>
  2027. </td>
  2028. <td>
  2029. string.rep fails if negative repetition; return ""; fails with ""
  2030. </td>
  2031. <td>
  2032. {{#invoke:Diagnostics/Luaj|string_rep_test|a|-1}}
  2033. </td>
  2034. <td>
  2035. pass:
  2036. <p>
  2037. <br>
  2038. </p>
  2039. </td>
  2040. </tr>
  2041. <tr>
  2042. <td>
  2043. <span style='color: green;'>pass</span>
  2044. </td>
  2045. <td>
  2046. string.gsub fails with ArrayIndexOutOfBoundsException; check for OutOfBounds; fails with ""
  2047. </td>
  2048. <td>
  2049. {{#invoke:Diagnostics/Luaj|string_gsub|a#b|#|}}
  2050. </td>
  2051. <td>
  2052. ab
  2053. <p>
  2054. <br>
  2055. </p>
  2056. </td>
  2057. </tr>
  2058. <tr>
  2059. <td>
  2060. <span style='color: green;'>pass</span>
  2061. </td>
  2062. <td>
  2063. string.gsub fails if src is empty string; exit early if empty; fails with ""
  2064. </td>
  2065. <td>
  2066. {{#invoke:Diagnostics/Luaj|string_gsub||%b&lt;&gt;|}}
  2067. </td>
  2068. <td>
  2069. <p>
  2070. <br>
  2071. </p>
  2072. </td>
  2073. </tr>
  2074. <tr>
  2075. <td>
  2076. <span style='color: green;'>pass</span>
  2077. </td>
  2078. <td>
  2079. string.gmatch: non-match
  2080. </td>
  2081. <td>
  2082. {{#invoke:Diagnostics/Luaj|string_gmatch|a|[^,]*}}
  2083. </td>
  2084. <td>
  2085. a;;
  2086. <p>
  2087. <br>
  2088. </p>
  2089. </td>
  2090. </tr>
  2091. <tr>
  2092. <td>
  2093. <span style='color: green;'>pass</span>
  2094. </td>
  2095. <td>
  2096. string.gmatch: match
  2097. </td>
  2098. <td>
  2099. {{#invoke:Diagnostics/Luaj|string_gmatch|a,b|[^,]*}}
  2100. </td>
  2101. <td>
  2102. a;;b;;
  2103. <p>
  2104. <br>
  2105. </p>
  2106. </td>
  2107. </tr>
  2108. <tr>
  2109. <td>
  2110. <span style='color: green;'>pass</span>
  2111. </td>
  2112. <td>
  2113. string.gmatch: convert example; plain text
  2114. </td>
  2115. <td>
  2116. {{#invoke:Diagnostics/Luaj|string_gmatch_convert|a}}
  2117. </td>
  2118. <td>
  2119. <p>
  2120. <br>
  2121. </p>
  2122. </td>
  2123. </tr>
  2124. <tr>
  2125. <td>
  2126. <span style='color: green;'>pass</span>
  2127. </td>
  2128. <td>
  2129. string.gmatch: convert example; lnki
  2130. </td>
  2131. <td>
  2132. {{#invoke:Diagnostics/Luaj|string_gmatch_convert|[[a]]}}
  2133. </td>
  2134. <td>
  2135. <p>
  2136. <br>
  2137. </p>
  2138. </td>
  2139. </tr>
  2140. <tr>
  2141. <td>
  2142. <span style='color: green;'>pass</span>
  2143. </td>
  2144. <td>
  2145. string.format does not use format args for double; call java.lang.String.format; fails with 1.234
  2146. </td>
  2147. <td>
  2148. {{#invoke:Diagnostics/Luaj|string_format|%.1f|1.234}}
  2149. </td>
  2150. <td>
  2151. 1.2
  2152. <p>
  2153. <br>
  2154. </p>
  2155. </td>
  2156. </tr>
  2157. <tr>
  2158. <td>
  2159. <span style='color: green;'>pass</span>
  2160. </td>
  2161. <td>
  2162. string.format fails for bad format; fails with ""
  2163. </td>
  2164. <td>
  2165. {{#invoke:Diagnostics/Luaj|string_format|(%0.1f%%)|1.234}}
  2166. </td>
  2167. <td>
  2168. (1.2%)
  2169. <p>
  2170. <br>
  2171. </p>
  2172. </td>
  2173. </tr>
  2174. <tr>
  2175. <td>
  2176. <span style='color: green;'>pass</span>
  2177. </td>
  2178. <td>
  2179. string.format fails if no number after "."; fails with ""
  2180. </td>
  2181. <td>
  2182. {{#invoke:Diagnostics/Luaj|string_format|%02.f|3}}
  2183. </td>
  2184. <td>
  2185. 03
  2186. <p>
  2187. <br>
  2188. </p>
  2189. </td>
  2190. </tr>
  2191. <tr>
  2192. <td>
  2193. <span style='color: green;'>pass</span>
  2194. </td>
  2195. <td>
  2196. string.format fails for char; fails with ""
  2197. </td>
  2198. <td>
  2199. {{#invoke:Diagnostics/Luaj|string_format|%c|97}}
  2200. </td>
  2201. <td>
  2202. a
  2203. <p>
  2204. <br>
  2205. </p>
  2206. </td>
  2207. </tr>
  2208. <tr>
  2209. <td>
  2210. <span style='color: green;'>pass</span>
  2211. </td>
  2212. <td>
  2213. string.format fails for multibyte chars; fails with ""
  2214. </td>
  2215. <td>
  2216. {{#invoke:Diagnostics/Luaj|string_format|âbç%f|1}}
  2217. </td>
  2218. <td>
  2219. âbç1.0
  2220. <p>
  2221. <br>
  2222. </p>
  2223. </td>
  2224. </tr>
  2225. <tr>
  2226. <td>
  2227. <span style='color: green;'>pass</span>
  2228. </td>
  2229. <td>
  2230. multibyte strings not supported; fails with ""
  2231. </td>
  2232. <td>
  2233. {{#invoke:Diagnostics/Luaj|string_multibyte_2}}
  2234. </td>
  2235. <td>
  2236. â
  2237. <p>
  2238. <br>
  2239. </p>
  2240. </td>
  2241. </tr>
  2242. <tr>
  2243. <td>
  2244. <span style='color: green;'>pass</span>
  2245. </td>
  2246. <td>
  2247. multibyte strings not supported; fails with ""
  2248. </td>
  2249. <td>
  2250. {{#invoke:Diagnostics/Luaj|string_multibyte_3}}
  2251. </td>
  2252. <td>
  2253. อา
  2254. <p>
  2255. <br>
  2256. </p>
  2257. </td>
  2258. </tr>
  2259. <tr>
  2260. <td>
  2261. <span style='color: green;'>pass</span>
  2262. </td>
  2263. <td>
  2264. multibyte chars in lua variables; used to return "?"
  2265. </td>
  2266. <td>
  2267. {{#invoke:Diagnostics/Luaj|ustring_match_multibyte|𠀀}}
  2268. </td>
  2269. <td>
  2270. 𠀀
  2271. <p>
  2272. <br>
  2273. </p>
  2274. </td>
  2275. </tr>
  2276. <tr>
  2277. <td>
  2278. <span style='color: green;'>pass</span>
  2279. </td>
  2280. <td>
  2281. handle backslash-escaped sequences like \239\191\185; used to return "11"
  2282. </td>
  2283. <td>
  2284. {{#invoke:Diagnostics/Luaj|multibyte__backslash_escaped}}
  2285. </td>
  2286. <td>
  2287. <p>
  2288. <br>
  2289. </p>
  2290. </td>
  2291. </tr>
  2292. <tr>
  2293. <td>
  2294. <span style='color: green;'>pass</span>
  2295. </td>
  2296. <td>
  2297. surrogate pair chars not supported; fails with ""
  2298. </td>
  2299. <td>
  2300. {{#invoke:Diagnostics/Luaj|string_surrogate_pair}}
  2301. </td>
  2302. <td>
  2303. 1
  2304. <p>
  2305. <br>
  2306. </p>
  2307. </td>
  2308. </tr>
  2309. <tr>
  2310. <td>
  2311. <span style='color: green;'>pass</span>
  2312. </td>
  2313. <td>
  2314. table.concat fails if end is nil; convert nil to list len; fails with ""
  2315. </td>
  2316. <td>
  2317. {{#invoke:Diagnostics/Luaj|table_concat|.|1||a|b|c}}
  2318. </td>
  2319. <td>
  2320. a.b.c
  2321. <p>
  2322. <br>
  2323. </p>
  2324. </td>
  2325. </tr>
  2326. <tr>
  2327. <td>
  2328. <span style='color: green;'>pass</span>
  2329. </td>
  2330. <td>
  2331. table.concat fails if sep is nil; convert nil to ""; fails with ""
  2332. </td>
  2333. <td>
  2334. {{#invoke:Diagnostics/Luaj|table_concat_nil_sep}}
  2335. </td>
  2336. <td>
  2337. ab
  2338. <p>
  2339. <br>
  2340. </p>
  2341. </td>
  2342. </tr>
  2343. <tr>
  2344. <td>
  2345. <span style='color: green;'>pass</span>
  2346. </td>
  2347. <td>
  2348. table.concat fails if 1st argument is nil; fails with "bad argument: string expected, got nil"
  2349. </td>
  2350. <td>
  2351. {{#invoke:Diagnostics/Luaj|table_remove_nil_arg_at_pos_1}}
  2352. </td>
  2353. <td>
  2354. ab
  2355. <p>
  2356. <br>
  2357. </p>
  2358. </td>
  2359. </tr>
  2360. <tr>
  2361. <td>
  2362. <span style='color: green;'>pass</span>
  2363. </td>
  2364. <td>
  2365. os_date does not accept utc argument; fails with ""<br>
  2366. NOTE: test assumes EST / EDT; if ! is not applied, then date would be 1969-12-31
  2367. </td>
  2368. <td>
  2369. {{#invoke:Diagnostics/Luaj|os_date|!*t|3600}}
  2370. </td>
  2371. <td>
  2372. 1970-01-01
  2373. <p>
  2374. <br>
  2375. </p>
  2376. </td>
  2377. </tr>
  2378. <tr>
  2379. <td>
  2380. <span style='color: green;'>pass</span>
  2381. </td>
  2382. <td>
  2383. os_date non-utc check;
  2384. </td>
  2385. <td>
  2386. {{#invoke:Diagnostics/Luaj|os_date|*t|0}}
  2387. </td>
  2388. <td>
  2389. 1969-12-31
  2390. <p>
  2391. <br>
  2392. </p>
  2393. </td>
  2394. </tr>
  2395. <tr>
  2396. <td>
  2397. <span style='color: green;'>pass</span>
  2398. </td>
  2399. <td>
  2400. os_date format: %e; fails with ""; NOTE: test assumes time zone within 11 hours of UTC
  2401. </td>
  2402. <td>
  2403. {{#invoke:Diagnostics/Luaj|os_date_format|%e|2014|07|15|1|2|3}}
  2404. </td>
  2405. <td>
  2406. 15
  2407. <p>
  2408. <br>
  2409. </p>
  2410. </td>
  2411. </tr>
  2412. <tr>
  2413. <td>
  2414. <span style='color: green;'>pass</span>
  2415. </td>
  2416. <td>
  2417. os_date format: %R; fails with ""
  2418. </td>
  2419. <td>
  2420. {{#invoke:Diagnostics/Luaj|os_date_format|%R|2014|07|15|13|2|3}}
  2421. </td>
  2422. <td>
  2423. 13:02
  2424. <p>
  2425. <br>
  2426. </p>
  2427. </td>
  2428. </tr>
  2429. <tr>
  2430. <td>
  2431. <span style='color: green;'>pass</span>
  2432. </td>
  2433. <td>
  2434. match.balanced: fails with out of bounds;
  2435. </td>
  2436. <td>
  2437. {{#invoke:Diagnostics/Luaj|string_match|a|%b()}}
  2438. </td>
  2439. <td>
  2440. <p>
  2441. <br>
  2442. </p>
  2443. </td>
  2444. </tr>
  2445. <tr>
  2446. <td>
  2447. <span style='color: green;'>pass</span>
  2448. </td>
  2449. <td>
  2450. match.balanced: fails with out of bounds; ^ at beginning
  2451. </td>
  2452. <td>
  2453. {{#invoke:Diagnostics/Luaj|string_match|a|^(.) ?%b()}}
  2454. </td>
  2455. <td>
  2456. <p>
  2457. <br>
  2458. </p>
  2459. </td>
  2460. </tr>
  2461. <tr>
  2462. <td>
  2463. <span style='color: green;'>pass</span>
  2464. </td>
  2465. <td>
  2466. match.frontier:error
  2467. </td>
  2468. <td>
  2469. {{#invoke:Diagnostics/Luaj|string_gmatch|a|%f[%a]b}}
  2470. </td>
  2471. <td>
  2472. <p>
  2473. <br>
  2474. </p>
  2475. </td>
  2476. </tr>
  2477. <tr>
  2478. <td>
  2479. <span style='color: green;'>pass</span>
  2480. </td>
  2481. <td>
  2482. match.frontier:bad-implementation; used to return ""
  2483. </td>
  2484. <td>
  2485. {{#invoke:Diagnostics/Luaj|lua_match|bz|%f[%a][%a]z$}}
  2486. </td>
  2487. <td>
  2488. bz
  2489. <p>
  2490. <br>
  2491. </p>
  2492. </td>
  2493. </tr>
  2494. <tr>
  2495. <td>
  2496. <span style='color: green;'>pass</span>
  2497. </td>
  2498. <td>
  2499. tonumber hex fails if incomplete
  2500. </td>
  2501. <td>
  2502. {{#invoke:Diagnostics/Luaj|tonumber_hex|0x}}
  2503. </td>
  2504. <td>
  2505. <p>
  2506. <br>
  2507. </p>
  2508. </td>
  2509. </tr>
  2510. <tr>
  2511. <td>
  2512. <span style='color: green;'>pass</span>
  2513. </td>
  2514. <td>
  2515. tonumber hex check
  2516. </td>
  2517. <td>
  2518. {{#invoke:Diagnostics/Luaj|tonumber_hex|0xFF}}
  2519. </td>
  2520. <td>
  2521. 255
  2522. <p>
  2523. <br>
  2524. </p>
  2525. </td>
  2526. </tr>
  2527. <tr>
  2528. <td>
  2529. <span style='color: green;'>pass</span>
  2530. </td>
  2531. <td>
  2532. string.gsub does not match $ at end of string
  2533. </td>
  2534. <td>
  2535. {{#invoke:Diagnostics/Luaj|string_gsub|ab|e?$|1}}
  2536. </td>
  2537. <td>
  2538. abe
  2539. <p>
  2540. <br>
  2541. </p>
  2542. </td>
  2543. </tr>
  2544. <tr>
  2545. <td>
  2546. <span style='color: green;'>pass</span>
  2547. </td>
  2548. <td>
  2549. table.unpack does not handle nil args; fails with error
  2550. </td>
  2551. <td>
  2552. {{#invoke:Diagnostics/Luaj|table_unpack_nil}}
  2553. </td>
  2554. <td>
  2555. a,b,c,d
  2556. <p>
  2557. <br>
  2558. </p>
  2559. </td>
  2560. </tr>
  2561. <tr>
  2562. <td>
  2563. <span style='color: green;'>pass</span>
  2564. </td>
  2565. <td>
  2566. surrogate pairs not handled correctly; fails with wrong 1st char: 𢱌
  2567. </td>
  2568. <td>
  2569. {{#invoke:Diagnostics/Luaj|core_surrogate_pairs}}
  2570. </td>
  2571. <td>
  2572. 𣂁 - 脁 - 晁
  2573. <p>
  2574. <br>
  2575. </p>
  2576. </td>
  2577. </tr>
  2578. <tr>
  2579. <td>
  2580. <span style='color: green;'>pass</span>
  2581. </td>
  2582. <td>
  2583. zero-length regex fails
  2584. </td>
  2585. <td>
  2586. {{#invoke:Diagnostics/Luaj|lua_match|text|}}
  2587. </td>
  2588. <td>
  2589. <p>
  2590. <br>
  2591. </p>
  2592. </td>
  2593. </tr>
  2594. <tr>
  2595. <td>
  2596. <span style='color: green;'>pass</span>
  2597. </td>
  2598. <td>
  2599. utf-8 char fails
  2600. </td>
  2601. <td>
  2602. {{#invoke:Diagnostics/Luaj|var|â|}}
  2603. </td>
  2604. <td>
  2605. â
  2606. <p>
  2607. <br>
  2608. </p>
  2609. </td>
  2610. </tr>
  2611. <tr>
  2612. <td>
  2613. <span style='color: green;'>pass</span>
  2614. </td>
  2615. <td>
  2616. fails if "2." is coerced to 2
  2617. </td>
  2618. <td>
  2619. {{#invoke:Diagnostics/Luaj|table_overwrite_int_with_string}}
  2620. </td>
  2621. <td>
  2622. 2.
  2623. <p>
  2624. <br>
  2625. </p>
  2626. </td>
  2627. </tr>
  2628. <tr>
  2629. <td>
  2630. <span style='color: green;'>pass</span>
  2631. </td>
  2632. <td>
  2633. fails if "a1"
  2634. </td>
  2635. <td>
  2636. {{#invoke:Diagnostics/Luaj|loadDataTest}}
  2637. </td>
  2638. <td>
  2639. pass1
  2640. <p>
  2641. <br>
  2642. </p>
  2643. </td>
  2644. </tr>
  2645. </table>
  2646. <h2>
  2647. <span class="mw-headline" id="ParserFunctions">ParserFunctions</span>
  2648. </h2>
  2649. <ul>
  2650. <li>
  2651. Calls code in <a href="/wiki/Module:Diagnostics/ParserFunctions" id="xolnki_18" title="Module:Diagnostics/ParserFunctions">Module:Diagnostics/ParserFunctions</a>
  2652. </li>
  2653. <li>
  2654. Tests functionality for mw.ext.ParserFunctions.lua
  2655. </li>
  2656. </ul>
  2657. <table class="wikitable">
  2658. <tr>
  2659. <th>
  2660. name
  2661. </th>
  2662. <th>
  2663. code
  2664. </th>
  2665. <th>
  2666. actl
  2667. </th>
  2668. <th>
  2669. rslt
  2670. </th>
  2671. </tr>
  2672. <tr>
  2673. <td>
  2674. <span style='color: green;'>pass</span>
  2675. </td>
  2676. <td>
  2677. basic expr
  2678. </td>
  2679. <td>
  2680. {{#invoke:Diagnostics/ParserFunctions|expr|1 + 2}}
  2681. </td>
  2682. <td>
  2683. 3
  2684. <p>
  2685. <br>
  2686. </p>
  2687. </td>
  2688. </tr>
  2689. </table>
  2690. <h2>
  2691. <span class="mw-headline" id="TitleBlacklist">TitleBlacklist</span>
  2692. </h2>
  2693. <ul>
  2694. <li>
  2695. Calls code in <a href="/wiki/Module:Diagnostics/TitleBlacklist" id="xolnki_19" title="Module:Diagnostics/TitleBlacklist">Module:Diagnostics/TitleBlacklist</a>
  2696. </li>
  2697. <li>
  2698. Tests functionality for mw.ext.TitleBlacklist.lua
  2699. </li>
  2700. </ul>
  2701. <table class="wikitable">
  2702. <tr>
  2703. <th>
  2704. name
  2705. </th>
  2706. <th>
  2707. code
  2708. </th>
  2709. <th>
  2710. actl
  2711. </th>
  2712. <th>
  2713. rslt
  2714. </th>
  2715. </tr>
  2716. <tr>
  2717. <td>
  2718. <span style='color: green;'>pass</span>
  2719. </td>
  2720. <td>
  2721. basic test; note that TitleBlacklists are not implemented in XOWA
  2722. </td>
  2723. <td>
  2724. {{#invoke:Diagnostics/TitleBlacklist|test|Title_to_check_for_blacklist}}
  2725. </td>
  2726. <td>
  2727. pass
  2728. <p>
  2729. <br>
  2730. </p>
  2731. </td>
  2732. </tr>
  2733. </table>
  2734. <p>
  2735. <br>
  2736. </p>
  2737. <h2>
  2738. <span class="mw-headline" id="FlaggedRevs">FlaggedRevs</span>
  2739. </h2>
  2740. <ul>
  2741. <li>
  2742. Calls code in <a href="/wiki/Module:Diagnostics/FlaggedRevs" id="xolnki_20" title="Module:Diagnostics/FlaggedRevs">Module:Diagnostics/FlaggedRevs</a>
  2743. </li>
  2744. <li>
  2745. Tests functionality for mw.ext.FlaggedRevs.lua
  2746. </li>
  2747. </ul>
  2748. <table class="wikitable">
  2749. <tr>
  2750. <th>
  2751. name
  2752. </th>
  2753. <th>
  2754. code
  2755. </th>
  2756. <th>
  2757. actl
  2758. </th>
  2759. <th>
  2760. rslt
  2761. </th>
  2762. </tr>
  2763. <tr>
  2764. <td>
  2765. <span style='color: green;'>pass</span>
  2766. </td>
  2767. <td>
  2768. basic test; note that FlaggedRevs are not implemented in XOWA
  2769. </td>
  2770. <td>
  2771. {{#invoke:Diagnostics/FlaggedRevs|test}}
  2772. </td>
  2773. <td>
  2774. 0;;infinity
  2775. <p>
  2776. <br>
  2777. </p>
  2778. </td>
  2779. </tr>
  2780. </table>
  2781. </div>
  2782. </div>
  2783. </div>
  2784. <div id="mw-head" class="noprint">
  2785. <div id="left-navigation">
  2786. <div id="p-namespaces" class="vectorTabs">
  2787. <h3>Namespaces</h3>
  2788. <ul>
  2789. <li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
  2790. </ul>
  2791. </div>
  2792. </div>
  2793. </div>
  2794. <div id='mw-panel' class='noprint'>
  2795. <div id='p-logo'>
  2796. <a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
  2797. </div>
  2798. <div class="portal" id='xowa-portal-home'>
  2799. <h3>XOWA</h3>
  2800. <div class="body">
  2801. <ul>
  2802. <li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
  2803. <li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
  2804. <li><a href="https://www.youtube.com/watch?v=q0qbXYXEH6M" title="See a video of XOWA Desktop in action">Video</a></li>
  2805. <li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
  2806. <li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
  2807. </ul>
  2808. </div>
  2809. </div>
  2810. <div class="portal" id='xowa-portal-started'>
  2811. <h3>Getting started</h3>
  2812. <div class="body">
  2813. <ul>
  2814. <li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
  2815. <li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
  2816. <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>
  2817. <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>
  2818. <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>
  2819. </ul>
  2820. </div>
  2821. </div>
  2822. <div class="portal" id='xowa-portal-android'>
  2823. <h3>Android</h3>
  2824. <div class="body">
  2825. <ul>
  2826. <li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
  2827. <li><a href="https://www.youtube.com/watch?v=jsMTBxGweUw" title="See a video of XOWA Android in action">Video</a></li>
  2828. </ul>
  2829. </div>
  2830. </div>
  2831. <div class="portal" id='xowa-portal-help'>
  2832. <h3>Help</h3>
  2833. <div class="body">
  2834. <ul>
  2835. <li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
  2836. <li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
  2837. <li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
  2838. <li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
  2839. </ul>
  2840. </div>
  2841. </div>
  2842. <div class="portal" id='xowa-portal-blog'>
  2843. <h3>Blog</h3>
  2844. <div class="body">
  2845. <ul>
  2846. <li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
  2847. </ul>
  2848. </div>
  2849. </div>
  2850. <div class="portal" id='xowa-portal-links'>
  2851. <h3>Links</h3>
  2852. <div class="body">
  2853. <ul>
  2854. <li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
  2855. <li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
  2856. <li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
  2857. </ul>
  2858. </div>
  2859. </div>
  2860. <div class="portal" id='xowa-portal-donate'>
  2861. <h3>Donate</h3>
  2862. <div class="body">
  2863. <ul>
  2864. <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/ -->
  2865. <li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
  2866. <li><a href="http://xowa.org/home/wiki/Help/Donate.html" title="Support XOWA!">XOWA</a></li>
  2867. </ul>
  2868. </div>
  2869. </div>
  2870. </div>
  2871. </body>
  2872. </html>