123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886 |
- <!DOCTYPE html>
- <html dir="ltr">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>Diagnostics/Scribunto/All - 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/All</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">
-
- <ul>
- <li>
- Note: This is not a comprehensive testing of all functions. (i.e.: there are some working functions that are not listed below)
- </li>
- </ul>
- <h2>
- <span class="mw-headline" id="Basic">Basic</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/Basic" id="xolnki_2" title="Module:Diagnostics/Basic">Module:Diagnostics/Basic</a>
- </li>
- <li>
- Tests basic Scribunto functionality
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- Init; Load; executeFunctionChunk
- </td>
- <td>
- {{#invoke:Diagnostics/Basic|print}}
- </td>
- <td>
- print
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- new line behavior
- </td>
- <td>
- {{#invoke:Diagnostics/Basic|new_line}}
- </td>
- <td>
- a
- <p>
- b
- </p>
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Lua_Common">Lua Common</span>
- </h2>
- <ul>
- <li>
- Calls code in
- <ul>
- <li>
- <a href="/wiki/Module:Diagnostics/LuaCommon" id="xolnki_3" title="Module:Diagnostics/LuaCommon">Module:Diagnostics/LuaCommon</a>
- </li>
- <li>
- <a href="/wiki/Template:Diagnostics/LuaCommon/getFrameTitle_parent" id="xolnki_4" title="Template:Diagnostics/LuaCommon/getFrameTitle parent">Template:Diagnostics/LuaCommon/getFrameTitle parent</a>
- </li>
- <li>
- <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>
- </li>
- </ul>
- </li>
- <li>
- Tests compatibility for <b>LuaCommon.php</b> and <b>mw.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getExpandedArgument
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getExpandedArgument_number_2 |val_1|val_2}}
- </td>
- <td>
- arg_1 is 'val_1'; arg_2 is 'val_2'
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getExpandedArgument_byOrdinal
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getExpandedArgument_by_ordinal |key_1=val_1|val_2}}
- </td>
- <td>
- [1] is 'val_2'
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getAllExpandedArguments
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getAllExpandedArguments |val_1|val_2|val_3}}
- </td>
- <td>
- 1:val_1;2:val_2;3:val_3;
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getAllExpandedArgs;key_is_int
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getAllExpandedArguments_int_key|1=a}}
- </td>
- <td>
- a
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess;redundant_keys
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|preprocess_ifeq_as_yn |val_1|val_1|when_true_val=y1|when_false_val=n1|when_true_val=y2}}
- </td>
- <td>
- y2
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- expandTemplate
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|expandTemplate|val_1|val_2}}
- </td>
- <td>
- arg_1 is val_1; arg_2 is val_2
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- expandTemplate; PHP bool; true -> 1 false -> ""
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|expandTemplate_bool}}
- </td>
- <td>
- bool_true is "1"; bool_false is "";
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- callParserFunction
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|callParserFunction|urlencode|abc}}
- </td>
- <td>
- abc
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isSubsting;false
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|isSubsting}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isSubsting;true
- </td>
- <td>
- {{safesubst:#invoke:Diagnostics/LuaCommon|isSubsting}}
- </td>
- <td>
- true
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getFrameTitle_current
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getFrameTitle_current}}
- </td>
- <td>
- Module:Diagnostics/LuaCommon
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getFrameTitle_parent
- </td>
- <td>
- {{Diagnostics/LuaCommon/getFrameTitle_parent}}
- </td>
- <td>
- Template:Diagnostics/LuaCommon/getFrameTitle parent
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getFrameTitle_parent.upper
- </td>
- <td>
- {{diagnostics/LuaCommon/getFrameTitle_parent}}
- </td>
- <td>
- Template:Diagnostics/LuaCommon/getFrameTitle parent
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- newChildFrame.title
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|newChildFrame_titled}}
- </td>
- <td>
- title:Title0; arg1:v1
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- newChildFrame.title
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|newChildFrame_untitled}}
- </td>
- <td>
- title:Module:Diagnostics/LuaCommon; arg1:v1
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess_args;frame is current
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|preprocess_args_current|match|y|n}}
- </td>
- <td>
- y
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess_args;frame is parent
- </td>
- <td>
- {{Diagnostics/LuaCommon/preprocess_args_parent|match|y|n}}
- </td>
- <td>
- y
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess calling Module functions should not call them twice; fails if onceonce
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|preprocess_nested_main}}
- </td>
- <td>
- once
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Ustring_Library">Ustring Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/UstringLibrary" id="xolnki_6" title="Module:Diagnostics/UstringLibrary">Module:Diagnostics/UstringLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>UstringLibrary.php</b> and <b>mw.ustring.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- match (via trim)
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|match| a b c |^%s*(.-)%s*$}}
- </td>
- <td>
- a b c
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- match error; only regx passed
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|match_error__regx_only}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gsub;replacement is string
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gsub_string|abcabc|[a]|A}}
- </td>
- <td>
- AbcAbc
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gsub;replacement is table
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gsub_table}}
- </td>
- <td>
- AbCAbC
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gsub;replacement is function (lua); basic
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gsub_function_lua_basic}}
- </td>
- <td>
- AbcAbc
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gsub;replacement is function (lua); grouping
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gsub_function_lua_grouping}}
- </td>
- <td>
- AbcAbc
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gsub;balanced group;<br>
- (will fail on Java 1.6, but not on Java 1.7+)
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gsub_string |(a)|%b()|c}}
- </td>
- <td>
- c
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gsub;regex with %W;<br>
- (will fail on Java 1.6, but not on Java 1.7+)
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gsub_string|[a]|[%W]|-}}
- </td>
- <td>
- -a-
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gmatch_init and gmatch_callback (via gmatch)
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gmatch|abcabc|a(b)}}
- </td>
- <td>
- b,;b,;
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- gsub; non-ASCII<br>
- (will print unrecognizable character)
- </td>
- <td>
- {{#invoke:Diagnostics/UstringLibrary|gsub_string|bß|[a]ß|c}}
- </td>
- <td>
- cß
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Uri_Library">Uri Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/UriLibrary" id="xolnki_7" title="Module:Diagnostics/UriLibrary">Module:Diagnostics/UriLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>UriLibrary.php</b> and <b>mw.uri.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- anchorEncode
- </td>
- <td>
- {{#invoke:Diagnostics/UriLibrary|anchorEncode|[irc://a b c]}}
- </td>
- <td>
- b_c
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- localUrl
- </td>
- <td>
- {{#invoke:Diagnostics/UriLibrary|localUrl|a&b! c}}
- </td>
- <td>
- /wiki/A%26b!_c
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- fullUrl
- </td>
- <td>
- {{#invoke:Diagnostics/UriLibrary|fullUrl|a&b! c}}
- </td>
- <td>
- //home/wiki/A%26b!_c
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- defaultUrl
- </td>
- <td>
- {{#invoke:Diagnostics/UriLibrary|defaultUrl}}
- </td>
- <td>
- //home/wiki/Diagnostics/Scribunto/All
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Language_Library">Language Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/LanguageLibrary" id="xolnki_8" title="Module:Diagnostics/LanguageLibrary">Module:Diagnostics/LanguageLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>LanguageLibrary.php</b> and <b>mw.language.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getContLangCode (by getContentLanguage)
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|getContLangCode}}
- </td>
- <td>
- en
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isKnownLanguageTag; true
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|en}}
- </td>
- <td>
- true
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isKnownLanguageTag; false
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|xyz}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isValidCode; true
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isValidCode|en}}
- </td>
- <td>
- true
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isValidCode; false
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isValidCode|a[b}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isValidBuiltInCode; true
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|en}}
- </td>
- <td>
- true
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isValidBuiltInCode; false
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|a#b}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- fetchLanguageName; code only
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageName|en|en}}
- </td>
- <td>
- English
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- fetchLanguageNames_get
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageNames_get|fr}}
- </td>
- <td>
- français
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- new
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|new_lang_code|fr}}
- </td>
- <td>
- fr
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- formatNum; en
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|formatNum|1234}}
- </td>
- <td>
- 1,234
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- parseFormatteNum; en
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|parseFormattedNum|1,234}}
- </td>
- <td>
- 1,234
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- formatDate via pcall; y;
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|2014-03-25}}
- </td>
- <td>
- y
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- formatDate via pcall; n;
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|fail}}
- </td>
- <td>
- n
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- convertGrammar
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|convertGrammar|fi|talo|elative}}
- </td>
- <td>
- talosta
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isRTL; en
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isRTL|en}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isRTL; ar
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|isRTL|ar}}
- </td>
- <td>
- true
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- format_durations_hms
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|format_durations_hms|123}}
- </td>
- <td>
- 2 minutes and 3 seconds
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- get_duration_intervals_hms
- </td>
- <td>
- {{#invoke:Diagnostics/LanguageLibrary|get_duration_intervals_hms|123}}
- </td>
- <td>
- ,2,3
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Site_Library">Site Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/SiteLibrary" id="xolnki_9" title="Module:Diagnostics/SiteLibrary">Module:Diagnostics/SiteLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>SiteLibrary.php</b> and <b>mw.site.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- siteName
- </td>
- <td>
- {{#invoke:Diagnostics/SiteLibrary|siteName}}
- </td>
- <td>
- home
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- ns_name
- </td>
- <td>
- {{#invoke:Diagnostics/SiteLibrary|ns_associated|Help}}
- </td>
- <td>
- Help talk
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Title_Library">Title Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/TitleLibrary" id="xolnki_10" title="Module:Diagnostics/TitleLibrary">Module:Diagnostics/TitleLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>TitleLibrary.php</b> and <b>mw.title.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- newTitle
- </td>
- <td>
- {{#invoke:Diagnostics/TitleLibrary|newTitle|Main_Page}}
- </td>
- <td>
- Main Page
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- newTitle; namespace arg
- </td>
- <td>
- {{#invoke:Diagnostics/TitleLibrary|newTitle|Contents|Help}}
- </td>
- <td>
- Help:Contents
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- makeTitle
- </td>
- <td>
- {{#invoke:Diagnostics/TitleLibrary|makeTitle|Help|Contents|Overview|home}}
- </td>
- <td>
- home:Help:Contents#Overview
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- fullUrl
- </td>
- <td>
- {{#invoke:Diagnostics/TitleLibrary|fullUrl|Help|Contents}}
- </td>
- <td>
- //home/wiki/Help:Contents
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getCurrentTitle
- </td>
- <td>
- {{#invoke:Diagnostics/TitleLibrary|getCurrentTitle}}
- </td>
- <td>
- Diagnostics/Scribunto/All
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Text_Library">Text Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/TextLibrary" id="xolnki_11" title="Module:Diagnostics/TextLibrary">Module:Diagnostics/TextLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>TextLibrary.php</b> and <b>mw.text.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- init_text_for_wiki (via listToText)
- </td>
- <td>
- {{#invoke:Diagnostics/TextLibrary|listToText|a|b|c}}
- </td>
- <td>
- a, b and c
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- unstrip
- </td>
- <td>
- {{#invoke:Diagnostics/TextLibrary|unstrip|abc}}
- </td>
- <td>
- abc
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getEntityTable (via decode)
- </td>
- <td>
- {{#invoke:Diagnostics/TextLibrary|decode|gt;}}
- </td>
- <td>
- >
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="HTML_Library">HTML Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/HtmlLibrary" id="xolnki_12" title="Module:Diagnostics/HtmlLibrary">Module:Diagnostics/HtmlLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>mw.html.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- create
- </td>
- <td>
- {{#invoke:Diagnostics/HtmlLibrary|create_span}}
- </td>
- <td>
- span
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Hash_Library">Hash Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/HashLibrary" id="xolnki_13" title="Module:Diagnostics/HashLibrary">Module:Diagnostics/HashLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>mw.hash.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- listAlgorithms
- </td>
- <td>
- {{#invoke:Diagnostics/HashLibrary|listAlgorithms|md2|tiger128,3|adler32|fnv132|haval128,3}}
- </td>
- <td>
- md2;tiger-128;adler32;fnv132;haval128,3;
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- hash.bouncycastle.md2
- </td>
- <td>
- {{#invoke:Diagnostics/HashLibrary|hashValue|md2|}}
- </td>
- <td>
- 4e8ddff3650292ab5a4108c3aa47940b
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- hash.jacksum.tiger128,3
- </td>
- <td>
- {{#invoke:Diagnostics/HashLibrary|hashValue|tiger128,3|}}
- </td>
- <td>
- 1714a472eee57d30040412bfcc55032a
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- hash.jre.adler32
- </td>
- <td>
- {{#invoke:Diagnostics/HashLibrary|hashValue|adler32|}}
- </td>
- <td>
- 90860b20
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- hash.jre.fnv132
- </td>
- <td>
- {{#invoke:Diagnostics/HashLibrary|hashValue|fnv132|}}
- </td>
- <td>
- 819dafd8
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- hash.gnu_crypto.haval128,3
- </td>
- <td>
- {{#invoke:Diagnostics/HashLibrary|hashValue|haval128,3|}}
- </td>
- <td>
- dc502247fb3eb8376109eda32d361d82
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Message_Library">Message Library</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/MessageLibrary" id="xolnki_14" title="Module:Diagnostics/MessageLibrary">Module:Diagnostics/MessageLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>MessageLibrary.php</b> and <b>mw.message.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- init_message_for_lang (via getDefaultLanguage)
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|getDefaultLanguage}}
- </td>
- <td>
- en
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- plain
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|plain|mainpage}}
- </td>
- <td>
- Main Page
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- plain; params
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|plain|redirectedfrom|A}}
- </td>
- <td>
- (Redirected from A)
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- exists; true
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|check|exists|sun}}
- </td>
- <td>
- true
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- exists; false
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|check|exists|sunx}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isBlank; false
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|check|isBlank|sun}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isDisabled; false
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|check|isDisabled|sun}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- inLanguage
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|plain_inLanguage|fr|sun}}
- </td>
- <td>
- Dim.
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- rawMessage_toString
- </td>
- <td>
- {{#invoke:Diagnostics/MessageLibrary|plain_rawMessage|a$1c|b}}
- </td>
- <td>
- abc
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="Wikibase_Library">Wikibase Library</span>
- </h2>
- <ul>
- <li>
- Wikidata needs to be installed for these tests to work
- </li>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/WikibaseLibrary" id="xolnki_15" title="Module:Diagnostics/WikibaseLibrary">Module:Diagnostics/WikibaseLibrary</a>
- </li>
- <li>
- Tests compatibility for <b>WikibaseLibrary.php</b> and <b>mw.wikibase.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: red;'>fail:<br>
- '</span>
- <pre>
- <span style='color: red;'>'<br>
- 'Earth
- '</span>
- </pre>
- </td>
- <td>
- getEntity
- </td>
- <td>
- {{#invoke:Diagnostics/WikibaseLibrary|label|q2}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <p>
- <br>
- </p>
- <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>
- Calls code in <a href="/wiki/Module:Diagnostics/Luaj" id="xolnki_16" title="Module:Diagnostics/Luaj">Module:Diagnostics/Luaj</a>
- </li>
- <li>
- Tests changes to the luaj_xowa.jar
- </li>
- <li>
- 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>
- </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>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- pairs.next fails when setting val to null; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|pairs_next}}
- </td>
- <td>
- ok
- <p>
- <br>
- </p>
- </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>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.gfind deprecated; should be alias to gmatch; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gfind|ab cd|%w+}}
- </td>
- <td>
- ab
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- tonumber('-') should be nil not 0
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|tonumber_lone|-}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- math.log10 deprecated; now calls Math.log10; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|math_log10|100}}
- </td>
- <td>
- 2
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- math.mod deprecated; now aliased to math.fmod; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|math_mod|3|2}}
- </td>
- <td>
- 1
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- table.maxn deprecated; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|table_maxn}}
- </td>
- <td>
- 3
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- table.getn deprecated -- key_is_num; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|table_getn__key_is_num}}
- </td>
- <td>
- 3
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- table.getn deprecated -- key_is_str; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|table_getn__key_is_str}}
- </td>
- <td>
- 0
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- automatic arg variable in varargs function deprecated; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|varargs_arg}}
- </td>
- <td>
- a
- <p>
- <br>
- </p>
- </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>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- tonumber should trim all white space, not just \s; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|value_tonumber_trim}}
- </td>
- <td>
- 123
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.rep fails if negative repetition; return ""; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_rep_test|a|-1}}
- </td>
- <td>
- pass:
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.gsub fails with ArrayIndexOutOfBoundsException; check for OutOfBounds; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gsub|a#b|#|}}
- </td>
- <td>
- ab
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.gmatch: non-match
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gmatch|a|[^,]*}}
- </td>
- <td>
- a;;
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.gmatch: match
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gmatch|a,b|[^,]*}}
- </td>
- <td>
- a;;b;;
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.gmatch: convert example; plain text
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gmatch_convert|a}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.gmatch: convert example; lnki
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gmatch_convert|[[a]]}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.format fails for bad format; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_format|(%0.1f%%)|1.234}}
- </td>
- <td>
- (1.2%)
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.format fails if no number after "."; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_format|%02.f|3}}
- </td>
- <td>
- 03
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.format fails for char; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_format|%c|97}}
- </td>
- <td>
- a
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.format fails for multibyte chars; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_format|âbç%f|1}}
- </td>
- <td>
- âbç1.0
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- multibyte strings not supported; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_multibyte_2}}
- </td>
- <td>
- â
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- multibyte strings not supported; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_multibyte_3}}
- </td>
- <td>
- อา
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- multibyte chars in lua variables; used to return "?"
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|ustring_match_multibyte|𠀀}}
- </td>
- <td>
- 𠀀
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- handle backslash-escaped sequences like \239\191\185; used to return "11"
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|multibyte__backslash_escaped}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- surrogate pair chars not supported; fails with ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_surrogate_pair}}
- </td>
- <td>
- 1
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- os_date non-utc check;
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|os_date|*t|0}}
- </td>
- <td>
- 1969-12-31
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <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
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- match.balanced: fails with out of bounds;
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_match|a|%b()}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- match.balanced: fails with out of bounds; ^ at beginning
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_match|a|^(.) ?%b()}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- match.frontier:error
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gmatch|a|%f[%a]b}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- match.frontier:bad-implementation; used to return ""
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|lua_match|bz|%f[%a][%a]z$}}
- </td>
- <td>
- bz
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- tonumber hex fails if incomplete
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|tonumber_hex|0x}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- tonumber hex check
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|tonumber_hex|0xFF}}
- </td>
- <td>
- 255
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- string.gsub does not match $ at end of string
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|string_gsub|ab|e?$|1}}
- </td>
- <td>
- abe
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- table.unpack does not handle nil args; fails with error
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|table_unpack_nil}}
- </td>
- <td>
- a,b,c,d
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- surrogate pairs not handled correctly; fails with wrong 1st char: 𢱌
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|core_surrogate_pairs}}
- </td>
- <td>
- 𣂁 - 脁 - 晁
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- zero-length regex fails
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|lua_match|text|}}
- </td>
- <td>
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- utf-8 char fails
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|var|â|}}
- </td>
- <td>
- â
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- fails if "2." is coerced to 2
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|table_overwrite_int_with_string}}
- </td>
- <td>
- 2.
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- fails if "a1"
- </td>
- <td>
- {{#invoke:Diagnostics/Luaj|loadDataTest}}
- </td>
- <td>
- pass1
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="ParserFunctions">ParserFunctions</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/ParserFunctions" id="xolnki_18" title="Module:Diagnostics/ParserFunctions">Module:Diagnostics/ParserFunctions</a>
- </li>
- <li>
- Tests functionality for mw.ext.ParserFunctions.lua
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- basic expr
- </td>
- <td>
- {{#invoke:Diagnostics/ParserFunctions|expr|1 + 2}}
- </td>
- <td>
- 3
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <h2>
- <span class="mw-headline" id="TitleBlacklist">TitleBlacklist</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/TitleBlacklist" id="xolnki_19" title="Module:Diagnostics/TitleBlacklist">Module:Diagnostics/TitleBlacklist</a>
- </li>
- <li>
- Tests functionality for mw.ext.TitleBlacklist.lua
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- basic test; note that TitleBlacklists are not implemented in XOWA
- </td>
- <td>
- {{#invoke:Diagnostics/TitleBlacklist|test|Title_to_check_for_blacklist}}
- </td>
- <td>
- pass
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
- <p>
- <br>
- </p>
- <h2>
- <span class="mw-headline" id="FlaggedRevs">FlaggedRevs</span>
- </h2>
- <ul>
- <li>
- Calls code in <a href="/wiki/Module:Diagnostics/FlaggedRevs" id="xolnki_20" title="Module:Diagnostics/FlaggedRevs">Module:Diagnostics/FlaggedRevs</a>
- </li>
- <li>
- Tests functionality for mw.ext.FlaggedRevs.lua
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- basic test; note that FlaggedRevs are not implemented in XOWA
- </td>
- <td>
- {{#invoke:Diagnostics/FlaggedRevs|test}}
- </td>
- <td>
- 0;;infinity
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
-
- </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>
- <li><a href="https://www.youtube.com/watch?v=q0qbXYXEH6M" title="See a video of XOWA Desktop in action">Video</a></li>
- <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>
- <li><a href="https://www.youtube.com/watch?v=jsMTBxGweUw" title="See a video of XOWA Android in action">Video</a></li>
- </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="http://xowa.org/home/wiki/Help/Donate.html" title="Support XOWA!">XOWA</a></li>
- </ul>
- </div>
- </div>
-
- </div>
- </body>
- </html>
|