mediawiki-extensions-Scribunto/tests/phpunit/engines/LuaCommon
Kunal Mehta a839ba855d Add mw.loadJsonData()
Backporting this so the LTS release has forwards compatibility with
Wikipedia templates.

mw.loadData() allows for optimizing the loading Lua tables by requiring
only one parse and lookup. However it's often easier for people to
write/maintain bulk data in JSON rather than Lua tables.

mw.loadJsonData() has roughly the same characteristics as mw.loadData()
and it can be used on JSON content model pages in any namespace.

As noted on the linked bug report, it's possible to already implement
this by writing a wrapper Lua module that loads and parses the JSON
content. But that requires a dummy module for each JSON page, which is
just annoying and inconvenient.

Test cases are copied from the mw.loadData() ones, with a few omissions
for syntax not supported in JSON (e.g. NaN, infinity, etc.).

Bug: T217500
Change-Id: I1b35ad27a37b94064707bb8c9b7108c7078ed4d1
(cherry picked from commit 1000d322e5)
2022-11-07 07:34:42 +00:00
..
CommonTests-data-fail1.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail2.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail3.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail4.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data-fail5.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-data.json Add mw.loadJsonData() 2022-11-07 07:34:42 +00:00
CommonTests-data.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests-lib.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
CommonTests.lua Add mw.loadJsonData() 2022-11-07 07:34:42 +00:00
HashLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
HashLibraryTests.lua Use tab indenting consistently 2020-10-23 16:39:12 +01:00
HtmlLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
HtmlLibraryTests.lua Use tab indenting consistently 2020-10-23 16:39:12 +01:00
LanguageLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LanguageLibraryTests.lua Update failing language tests 2022-08-29 16:20:59 -05:00
LibraryUtilTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LibraryUtilTests.lua Use tab indenting consistently 2020-10-23 16:39:12 +01:00
LuaCommonTest.php Add mw.loadJsonData() 2022-11-07 07:34:42 +00:00
LuaCommonTestsFailLibrary.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaCommonTestsLibrary.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaDataProvider.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaEngineTestBase.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaEngineTestHelper.php Add mw.loadJsonData() 2022-11-07 07:34:42 +00:00
LuaEngineTestSkip.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaEngineUnitTestBase.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaEnvironmentComparisonTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaInterpreterTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
LuaUstringLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
MessageLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
MessageLibraryTests.lua build: Updating mediawiki/mediawiki-phan-config to 0.10.4 2020-11-20 17:01:25 +00:00
SiteLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
SiteLibraryTests.lua Use tab indenting consistently 2020-10-23 16:39:12 +01:00
TestFramework.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
TextLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
TextLibraryTests.lua Use tab indenting consistently 2020-10-23 16:39:12 +01:00
TitleLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
TitleLibraryTests.lua Revert "Add test for pageLanguage property" 2022-02-09 02:10:18 +00:00
UriLibraryTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
UriLibraryTests.lua Use tab indenting consistently 2020-10-23 16:39:12 +01:00
UstringLibraryNormalizationTestProvider.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
UstringLibraryNormalizationTests.lua Move tests into tests/phpunit and remove UnitTestsList hook 2017-07-07 13:50:39 -07:00
UstringLibraryPureLuaTest.php Revert "Namespace LuaCommon" 2022-08-03 10:03:12 +00:00
UstringLibraryTests.lua Fix a typo: emtpy -> empty 2020-11-22 14:22:33 +00:00