mediawiki-extensions-Scribunto/tests/phpunit/Engines/LuaCommon
Kunal Mehta 1000d322e5 Add mw.loadJsonData()
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
2022-10-13 04:46:25 +00:00
..
CommonTests-data-fail1.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
CommonTests-data-fail2.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
CommonTests-data-fail3.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
CommonTests-data-fail4.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
CommonTests-data-fail5.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
CommonTests-data.json Add mw.loadJsonData() 2022-10-13 04:46:25 +00:00
CommonTests-data.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
CommonTests-lib.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
CommonTests.lua Add mw.loadJsonData() 2022-10-13 04:46:25 +00:00
HashLibraryTest.php Add more @covers 2022-10-08 20:59:33 +01:00
HashLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
HtmlLibraryTest.php Add more @covers 2022-10-08 20:59:33 +01:00
HtmlLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
LanguageLibraryTest.php Namespace tests 2022-09-30 00:59:00 +00:00
LanguageLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
LibraryUtilTest.php Add more @covers 2022-10-08 20:59:33 +01:00
LibraryUtilTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
LuaCommonTest.php Add mw.loadJsonData() 2022-10-13 04:46:25 +00:00
LuaCommonTestsFailLibrary.php Namespace tests 2022-09-30 00:59:00 +00:00
LuaCommonTestsLibrary.php Namespace tests 2022-09-30 00:59:00 +00:00
LuaDataProvider.php Namespace tests 2022-09-30 00:59:00 +00:00
LuaEngineTestBase.php Namespace tests 2022-09-30 00:59:00 +00:00
LuaEngineTestHelper.php Add mw.loadJsonData() 2022-10-13 04:46:25 +00:00
LuaEngineTestSkip.php Namespace tests 2022-09-30 00:59:00 +00:00
LuaEngineUnitTestBase.php Namespace tests 2022-09-30 00:59:00 +00:00
LuaEnvironmentComparisonTest.php Namespace tests 2022-09-30 00:59:00 +00:00
LuaInterpreterTest.php Namespace tests 2022-09-30 00:59:00 +00:00
MessageLibraryTest.php Add more @covers 2022-10-08 20:59:33 +01:00
MessageLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
SiteLibraryTest.php Add more @covers 2022-10-08 20:59:33 +01:00
SiteLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
TestFramework.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
TextLibraryTest.php Add more @covers 2022-10-08 20:59:33 +01:00
TextLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
TitleLibraryTest.php Namespace tests 2022-09-30 00:59:00 +00:00
TitleLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
UriLibraryTest.php Add more @covers 2022-10-08 20:59:33 +01:00
UriLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
UstringLibraryNormalizationTestProvider.php Namespace tests 2022-09-30 00:59:00 +00:00
UstringLibraryNormalizationTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
UstringLibraryPureLuaTest.php Namespace tests 2022-09-30 00:59:00 +00:00
UstringLibraryTest.php Namespace tests 2022-09-30 00:59:00 +00:00
UstringLibraryTests.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00