User talk:TedSwippet/Experimental

Lua module
I suggest creating a Lua code module instead of a source code listing. The reference manual is here: Extension:Scribunto/Lua reference manual --LadyGeek 14:28, 23 January 2021 (UTC)
 * Of course! That's the next step, once I'm happy with the operation of the code as it stands. Currently testing in the Module console, and stored here just for convenience (and visibility, I suppose).
 * Lua cannot be run from anywhere except Module. I notice that the Module namespace has no Sandbox. I could start there. However, Wikipedia uses a pseudo-namespace system to avoid the main Module namespace filling up with experiments. Should we do something similar? Or is a new and single Module:Sandbox sufficient? --TedSwippet 16:02, 23 January 2021 (UTC)
 * A single sandbox is sufficient, but we should do this right and setup a test environment. Take a look at Module:ThisWeekInFinancialHistory and note the text block under the documentation section. Click on testcases and see how I set this up. The templates are provided by the scribunto extension. Results are in the Talk: page here. Test cases are buried in the Lua documentation somewhere, maybe with some examples.
 * My single test case is not sufficient for your purposes, but it shows the intent. Compare (less than, equal, greater than) to an expected result. --LadyGeek 22:19, 23 January 2021 (UTC)