mediawiki-extensions-Scribunto/includes/engines/LuaCommon/lualib
Brad Jorsch 18c08c23fc ustring: Match undocumented string.gsub behavior
As documented, string.gub( 'foo', '%a', '%1' ) should raise an invalid
capture index error because there is no capture with index 1 in the
pattern. But in fact it treats %1 as %0 in this situation. The ustring
library should match this behavior.

This patch also adds some tests for the behavior of gsub with table and
function replacements when the pattern does have captures.

Bug: T207623
Change-Id: Ie3e6c2eafa4a05989815c62c7037167642581751
2018-11-01 03:59:35 +00:00
..
luabit Move classes into includes/ 2018-04-09 08:54:22 -07:00
ustring ustring: Match undocumented string.gsub behavior 2018-11-01 03:59:35 +00:00
bit32.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
libraryUtil.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.hash.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.html.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.language.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.message.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.site.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.text.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.title.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.uri.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mw.ustring.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
mwInit.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00
package.lua Move classes into includes/ 2018-04-09 08:54:22 -07:00