Content deleted Content added
→Table display: reply |
m Replaced deprecated <source> tags with <syntaxhighlight> (via WP:JWB) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 15:
::: Great. But perhaps we should name it <code>assertStringContains</code> in case we later implement a method that checks if a table contains a given table key? And yes, we should have tests for the assertions as well. I'm not really sure how to write good tests for a testing module, but I started experimenting on [[Module:ScribuntoUnit/testcases]]. – ''[[User:Danmichaelo|Danmichaelo]] ([[User talk:Danmichaelo|talk]])'' 08:42, 3 January 2014 (UTC)
:::: So renamed. Sounds like a good reason to me. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 14:05, 3 January 2014 (UTC)
::: Automated tests are needed, but I think there is also a need for a visual presentation of how the module works in practise. I have created such a page: [[Module:ScribuntoUnit/showcase]] (run on the talk page). If I did not invoke something wrong, it seems that
:::: Agree, the showcase page is a good idea. Seems like the output is not so consistent between the different methods; on failure, some methods include "actual" and "expected", while others do not. If "actual" and "expected" are included, "message" is not shown. This leads me to thinking that we might be better of just replacing the two columns by a single column. I updated [[Module:ScribuntoUnit/sandbox]] and [[Module talk:ScribuntoUnit/showcase]]. What do you think? – ''[[User:Danmichaelo|Danmichaelo]] ([[User talk:Danmichaelo|talk]])'' 18:21, 5 January 2014 (UTC)
::: I made small tweaks to the sandbox code. I like it now. --[[User:Derbeth|Derbeth]] [[User talk:Derbeth|<sup>talk</sup>]] 10:31, 6 January 2014 (UTC)
Line 30:
: Hm, how does it fail? I tried using mw.title at [[Module_talk:ScribuntoUnit/showcase]], and it seems to work, but I'm not familiar with it. – ''[[User:Danmichaelo|Danmichaelo]] ([[User talk:Danmichaelo|talk]])'' 18:47, 5 January 2014 (UTC)
:: You used the mw.title library, rather than a title object. To get a title object you need to use code like <code>mw.title.new('Wikipedia:Sandbox')</code>. I tried doing just that in the showcase module, and the whole script fails with a "not enough memory" error. The problem is that some of the title object fields are self-references. For example:
<
local sandbox = mw.title.new('Wikipedia:Sandbox') -- title object for [[Wikipedia:Sandbox]]
sandbox.basePageTitle -- Also the title object for [[Wikipedia:Sandbox]]
sandbox.basePageTitle.basePageTitle -- Again, the same title object.
</syntaxhighlight>
:: So if you try and iterate recursively through any given title object, while respecting metatables, you will just keep on going forever. Scribunto then dies when it runs into the memory limit. This problem has been resolved somehow in mw.logObject, but I haven't looked deeply enough at the code to know exactly what was done. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 11:06, 6 January 2014 (UTC)
== Failure category, config module ==
{{ping|Luis150902}} thanks for your recent module config changes. A while ago I adapted this module to be used at the English Wiktionary. One thing I found lacking was a category the test page automatically gets assigned to upon failure. Maybe this could now be added as a configurable setting? I would also suggest to move the configuration into <code>Module:ScribuntoUnit/configuration</code> or similar, so that the module can be copied as is. – [[User:Jberkel|Jberkel]] ([[User talk:Jberkel|talk]]) 05:22, 26 February 2018 (UTC)
:{{ping|Jberkel}} {{done}} [[User:Luis150902|<span style="color:#f00;">Luis150902</span>]] ([[User talk:Luis150902|<span style="color:#990;">talk</span>]] | [[Special:Contributions/Luis150902|<span style="color:#008000;">contribs</span>]]) 18:35, 26 February 2018 (UTC)
== Internationalizing this module ==
Hi, would anyone be interested in collaborating on making this module multilingual using [[Module:TNT]]? With this approach, we will get these benefits:
* identical code on all wikis, using global translation table
* no need for config submodule - can store than in the translation table too
* Once in sync, keeping it in sync will be easier with [[mw:WP:TNT|multilingual distribution system]].
--[[User:Yurik|Yurik]] ([[User talk:Yurik|talk]]) 22:25, 5 May 2019 (UTC)
|