<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AUstring%2Ftestcases</id>
	<title>Module:Ustring/testcases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AUstring%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Ustring/testcases&amp;action=history"/>
	<updated>2026-04-21T14:48:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Ustring/testcases&amp;diff=147549&amp;oldid=prev</id>
		<title>imported&gt;GKFX: test gsub</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Ustring/testcases&amp;diff=147549&amp;oldid=prev"/>
		<updated>2021-11-14T11:40:18Z</updated>

		<summary type="html">&lt;p&gt;test gsub&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Unit tests for [[Module:Ustring]]. Click talk page to run tests.&lt;br /&gt;
local p = require(&amp;#039;Module:UnitTests&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- Test sub function&lt;br /&gt;
function p:test_sub()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:ustring&amp;#039;, &amp;#039;sub&amp;#039;, {&lt;br /&gt;
		{&amp;#039; hello | 1 | 3&amp;#039;, &amp;#039; he&amp;#039;},&lt;br /&gt;
		{&amp;#039; s1 = hello | 1 | 3&amp;#039;, &amp;#039;hel&amp;#039;},&lt;br /&gt;
		{&amp;#039; s1 = hello | 0 | 3&amp;#039;, &amp;#039;hel&amp;#039;},&lt;br /&gt;
		{&amp;#039; s1 = hello | -3 &amp;#039;, &amp;#039;llo&amp;#039;},&lt;br /&gt;
		{&amp;#039; hello | -3 &amp;#039;, &amp;#039;lo &amp;#039;},&lt;br /&gt;
	})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Test error supression&lt;br /&gt;
function p:test_onerror()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:ustring&amp;#039;, &amp;#039;sub&amp;#039;, {&lt;br /&gt;
		{&amp;#039; hello | 1 | 3 | onerror = foo&amp;#039;, &amp;#039; he&amp;#039;},&lt;br /&gt;
		{&amp;#039; s1 = hello | bar | 3 | onerror = foo&amp;#039;, &amp;#039;foo&amp;#039;},&lt;br /&gt;
		{&amp;#039; s1 = hello | 0 |  | onerror = foo&amp;#039;, &amp;#039;foo&amp;#039;},&lt;br /&gt;
	})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Test find/replace&lt;br /&gt;
function p:test_gsub()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:ustring&amp;#039;, &amp;#039;gsub&amp;#039;, {&lt;br /&gt;
		{&amp;#039; hello world | world | x &amp;#039;, &amp;#039; hello x &amp;#039;},&lt;br /&gt;
		{&amp;#039; hello world| world | x &amp;#039;, &amp;#039; hello world&amp;#039;},&lt;br /&gt;
	})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;GKFX</name></author>
	</entry>
</feed>