<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://moasspedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AURL%2Ftestcases</id>
	<title>Module:URL/testcases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://moasspedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AURL%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://moasspedia.org/w/index.php?title=Module:URL/testcases&amp;action=history"/>
	<updated>2026-04-13T15:53:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://moasspedia.org/w/index.php?title=Module:URL/testcases&amp;diff=3620&amp;oldid=prev</id>
		<title>Wikipedia&gt;Danski454: moved test case for URL extraction</title>
		<link rel="alternate" type="text/html" href="https://moasspedia.org/w/index.php?title=Module:URL/testcases&amp;diff=3620&amp;oldid=prev"/>
		<updated>2019-07-24T23:36:14Z</updated>

		<summary type="html">&lt;p&gt;moved test case for URL extraction&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Unit tests for [[Module:URL]]. Click talk page to run tests.&lt;br /&gt;
local p = require(&amp;#039;Module:UnitTests&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
function p:test_url()&lt;br /&gt;
    local cases = {&lt;br /&gt;
        &amp;#039;{{#invoke:URL/sandbox|url}}&amp;#039;,&lt;br /&gt;
        &amp;#039;{{#invoke:URL/sandbox|url|}}&amp;#039;,&lt;br /&gt;
        &amp;#039;{{#invoke:URL/sandbox|url||}}&amp;#039;,&lt;br /&gt;
    }&lt;br /&gt;
    text = self.frame:expandTemplate{ title = &amp;#039;tlx&amp;#039;, args = { &amp;#039;URL&amp;#039;, &amp;quot;&amp;#039;&amp;#039;example.com&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;optional display text&amp;#039;&amp;#039;&amp;quot; } }&lt;br /&gt;
    for _, case in ipairs(cases) do&lt;br /&gt;
        self:preprocess_equals(case, text)&lt;br /&gt;
    end&lt;br /&gt;
        &lt;br /&gt;
    cases = {&lt;br /&gt;
    	{&amp;#039;http://www.example.com/foo/bar?a=b&amp;amp;c=d&amp;#039;, &amp;#039;[http://www.example.com/foo/bar?a=b&amp;amp;c=d www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar?a=b&amp;amp;c=d]&amp;#039;},&lt;br /&gt;
        {&amp;#039;EXAMPLE.com&amp;#039;, &amp;#039;[http://EXAMPLE.com example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;example.com&amp;#039;, &amp;#039;[http://example.com example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com&amp;#039;, &amp;#039;[http://www.example.com www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com&amp;#039;, &amp;#039;[http://www.example.com www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;https://www.example.com&amp;#039;, &amp;#039;[https://www.example.com www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;ftp://www.example.com&amp;#039;, &amp;#039;[ftp://www.example.com www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;//www.example.com&amp;#039;, &amp;#039;[//www.example.com www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;ftp://ftp.example.com&amp;#039;, &amp;#039;[ftp://ftp.example.com ftp&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/&amp;#039;, &amp;#039;[http://www.example.com/ www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/path&amp;#039;, &amp;#039;[http://www.example.com/path www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/path]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo&amp;#039;, &amp;#039;[http://www.example.com/foo www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/foo | link&amp;#039;, &amp;#039;[http://www.example.com/foo link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo | link&amp;#039;, &amp;#039;[http://www.example.com/foo link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/path/&amp;#039;, &amp;#039;[http://www.example.com/path/ www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/path&amp;lt;wbr/&amp;gt;/]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo/&amp;#039;, &amp;#039;[http://www.example.com/foo/ www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/]&amp;#039;},&lt;br /&gt;
        {&amp;#039;1=http://www.example.com/path?section=17&amp;#039;, &amp;#039;[http://www.example.com/path?section=17 www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/path?section=17]&amp;#039;},&lt;br /&gt;
        {&amp;#039;1=www.example.com/foo?page=42 &amp;#039;, &amp;#039;[http://www.example.com/foo?page=42 www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo?page=42]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/foo/ | link&amp;#039;, &amp;#039;[http://www.example.com/foo/ link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo/ | link&amp;#039;, &amp;#039;[http://www.example.com/foo/ link]&amp;#039;},&lt;br /&gt;
        &lt;br /&gt;
        -- From [[Template:URL/testcases]] (and not already listed above)&lt;br /&gt;
        {&amp;#039;http://&amp;#039;, &amp;#039;[http:// ]&amp;#039;},&lt;br /&gt;
        {&amp;#039;WWW.EXAMPLE.COM&amp;#039;, &amp;#039;[http://WWW.EXAMPLE.COM www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;https://www.EXAMPLE.cOm&amp;#039;, &amp;#039;[https://www.EXAMPLE.cOm www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;HTTPS://www.EXAMPLE.cOm/&amp;#039;, &amp;#039;[HTTPS://www.EXAMPLE.cOm/ www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;https://www.example.com/&amp;#039;, &amp;#039;[https://www.example.com/ www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://example.com&amp;#039;, &amp;#039;[http://example.com example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;https://example.com&amp;#039;, &amp;#039;[https://example.com example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;ftp://example.com&amp;#039;, &amp;#039;[ftp://example.com example&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/foo/bar&amp;#039;, &amp;#039;[http://www.example.com/foo/bar www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/foo/bar/&amp;#039;, &amp;#039;[http://www.example.com/foo/bar/ www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar&amp;lt;wbr/&amp;gt;/]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/foO/BaR&amp;#039;, &amp;#039;[http://www.example.com/foO/BaR www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foO&amp;lt;wbr/&amp;gt;/BaR]&amp;#039;},&lt;br /&gt;
        {&amp;#039;https://www.example.com/foo/bar&amp;#039;, &amp;#039;[https://www.example.com/foo/bar www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://example.com/foo/bar&amp;#039;, &amp;#039;[http://example.com/foo/bar example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;https://example.com/foo/bar&amp;#039;, &amp;#039;[https://example.com/foo/bar example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;example.com/foo/bar&amp;#039;, &amp;#039;[http://example.com/foo/bar example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo/bar&amp;#039;, &amp;#039;[http://www.example.com/foo/bar www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://example.com/foo/bar | &amp;#039;, &amp;#039;[http://example.com/foo/bar example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;1=http://www.example.com?foo=BaR&amp;#039;, &amp;#039;[http://www.example.com?foo=BaR www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com?foo=BaR]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com#fooBaR&amp;#039;, &amp;#039;[http://www.example.com#fooBaR www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;#fooBaR]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com:8080&amp;#039;, &amp;#039;[http://www.example.com:8080 www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com:8080]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com:8080/foo/bar&amp;#039;, &amp;#039;[http://www.example.com:8080/foo/bar www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com:8080&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com:8080&amp;#039;, &amp;#039;[http://www.example.com:8080 www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com:8080]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com:8080/foo/bar&amp;#039;, &amp;#039;[http://www.example.com:8080/foo/bar www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com:8080&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.example.com/foo bar&amp;#039;, &amp;#039;[http://www.example.com/foo%20bar www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo%20bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo bar&amp;#039;, &amp;#039;[http://www.example.com/foo%20bar www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo%20bar]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://example.com/foo/bar | link&amp;#039;, &amp;#039;[http://example.com/foo/bar link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;https://example.com/foo/bar | link&amp;#039;, &amp;#039;[https://example.com/foo/bar link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;example.com/foo/bar | link&amp;#039;, &amp;#039;[http://example.com/foo/bar link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo/bar | link&amp;#039;, &amp;#039;[http://www.example.com/foo/bar link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo/bar | 捦挺挎&amp;#039;, &amp;#039;[http://www.example.com/foo/bar 捦挺挎]&amp;#039;},&lt;br /&gt;
        {&amp;#039;www.example.com/foo/捦挺挎/bar | link&amp;#039;, &amp;#039;[http://www.example.com/foo/捦挺挎/bar link]&amp;#039;},&lt;br /&gt;
        {&amp;#039;عمان.icom.museum&amp;#039;, &amp;#039;[http://عمان.icom.museum عمان&amp;lt;wbr/&amp;gt;.icom&amp;lt;wbr/&amp;gt;.museum]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://عمان.icom.museum&amp;#039;, &amp;#039;[http://عمان.icom.museum عمان&amp;lt;wbr/&amp;gt;.icom&amp;lt;wbr/&amp;gt;.museum]&amp;#039;},&lt;br /&gt;
        {&amp;#039;1964thetribute.com&amp;#039;, &amp;#039;[http://1964thetribute.com 1964thetribute&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;1964thetribute.com | 1964thetribute.com&amp;#039;, &amp;#039;[http://1964thetribute.com 1964thetribute&amp;lt;wbr/&amp;gt;.com]&amp;#039;},&lt;br /&gt;
        {&amp;#039;1= http://www.example.com/foo/bar?a=b&amp;amp;c=d&amp;#039;, &amp;#039;[http://www.example.com/foo/bar?a=b&amp;amp;c=d www&amp;lt;wbr/&amp;gt;.example&amp;lt;wbr/&amp;gt;.com&amp;lt;wbr/&amp;gt;/foo&amp;lt;wbr/&amp;gt;/bar?a=b&amp;amp;c=d]&amp;#039;},&lt;br /&gt;
        {&amp;#039;1=www.hti.umich.edu/cgi/t/text/pageviewer-idx?c=umhistmath;cc=umhistmath;rgn=full%20text;idno=ABS3153.0001.001;didno=ABS3153.0001.001;view=image;seq=00000140&amp;#039;,&lt;br /&gt;
            &amp;#039;[http://www.hti.umich.edu/cgi/t/text/pageviewer-idx?c=umhistmath;cc=umhistmath;rgn=full%20text;idno=ABS3153.0001.001;didno=ABS3153.0001.001;view=image;seq=00000140 www&amp;lt;wbr/&amp;gt;.hti&amp;lt;wbr/&amp;gt;.umich&amp;lt;wbr/&amp;gt;.edu&amp;lt;wbr/&amp;gt;/cgi&amp;lt;wbr/&amp;gt;/t&amp;lt;wbr/&amp;gt;/text&amp;lt;wbr/&amp;gt;/pageviewer-idx?c=umhistmath%3Bcc%3Dumhistmath%3Brgn%3Dfull+text%3Bidno%3DABS3153&amp;lt;wbr/&amp;gt;.0001&amp;lt;wbr/&amp;gt;.001%3Bdidno%3DABS3153&amp;lt;wbr/&amp;gt;.0001&amp;lt;wbr/&amp;gt;.001%3Bview%3Dimage%3Bseq%3D00000140]&amp;#039;},&lt;br /&gt;
        {&amp;#039;http://www.sho.com/site/dexter/home.sho | \&amp;#039;\&amp;#039;Dexter\&amp;#039;\&amp;#039;{{\&amp;#039;}}s official website&amp;#039;,&lt;br /&gt;
        	&amp;#039;[http://www.sho.com/site/dexter/home.sho \&amp;#039;\&amp;#039;Dexter\&amp;#039;\&amp;#039;&amp;lt;span class=&amp;quot;nowrap&amp;quot; style=&amp;quot;padding-left:0.1em;&amp;quot;&amp;gt;&amp;amp;#39;&amp;lt;/span&amp;gt;s official website]&amp;#039; },&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    for _, case in ipairs(cases) do&lt;br /&gt;
        self:preprocess_equals(&amp;#039;{{#invoke:URL/sandbox|url|&amp;#039; .. case[1] .. &amp;#039;}}&amp;#039;, &amp;#039;&amp;lt;span class=&amp;quot;url&amp;quot;&amp;gt;&amp;#039; .. case[2] .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;, {nowiki=true})&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    self:preprocess_equals(&amp;#039;{{#invoke:URL/sandbox|url|2= example.com}}&amp;#039;, &amp;#039;example.com&amp;#039;, {nowiki=true})&lt;br /&gt;
    self:preprocess_equals(&amp;#039;{{#invoke:URL/sandbox|url|2= http://example.com/foo}}&amp;#039;, &amp;#039;http://example.com/foo&amp;#039;, {nowiki=true})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;Danski454</name></author>
	</entry>
</feed>