From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001
From: Pierre Schmitz
Date: Sat, 27 Dec 2014 15:41:37 +0100
Subject: Update to MediaWiki 1.24.1
---
extensions/ParserFunctions/funcsParserTests.txt | 88 +++++++++++++++++++++++++
1 file changed, 88 insertions(+)
(limited to 'extensions/ParserFunctions/funcsParserTests.txt')
diff --git a/extensions/ParserFunctions/funcsParserTests.txt b/extensions/ParserFunctions/funcsParserTests.txt
index 2ff7ba3d..06224bad 100644
--- a/extensions/ParserFunctions/funcsParserTests.txt
+++ b/extensions/ParserFunctions/funcsParserTests.txt
@@ -21,6 +21,18 @@ File:Dionysos-Brunnen am Kölner Dom.jpg
blah blah
!! endarticle
+!! article
+File:Redirect_to_Foobar.jpg
+!! text
+#REDIRECT[[File:Foobar.jpg]]
+!! endarticle
+
+!! article
+File:Redirect_to_nowhere.jpg
+!! text
+#REDIRECT[[File:Missing target file.jpg]]
+!! endarticle
+
!! test
Input times are UTC, not local time
!! input
@@ -126,6 +138,21 @@ Not found
!! end
+!! test
+{{#ifexist:}} media redirect (bug 32031)
+!! input
+{{#ifexist:Media:Redirect_to_Foobar.jpg|Found|Not found}}
+{{#ifexist:Media:Redirect_to_nowhere.jpg|Found|Not found}}
+{{#ifexist:Media:Missing file.jpg|Found|Not found}}
+{{#ifexist:Media:Dionysos-Brunnen am Kölner Dom.jpg|Found|Not found}}
+!!result
+Found
+Not found
+Not found
+Not found
+
+!!end
+
!! test
#if
!! input
@@ -173,6 +200,23 @@ no
!! end
+!! test
+#ifeq entities
+!!input
+{{#ifeq: {{PAGENAME:*foo&bar}} | *foo&bar | yes | no}}
+{{#ifeq: a'b | a'b | yes | no}}
+{{#ifeq: a'b | a'b | yes | no}}
+{{#ifeq: foo | Foo | *yes | *no}}
+!! result
+yes
+yes
+no
+
+
+
+!! end
+
+
!! test
#iferror
!!input
@@ -232,3 +276,47 @@ Templates: Parser functions don't strip whitespace from positional parameters
no-pre-then
!! end
+
+!! test
+#switch
+!! input
+{{#switch:foo&bar|foo&bar=yes|no}}
+{{#switch:foo&bar|fred=1|foo&bar|g=yes|no}}
+{{#switch:foo&bar|fred=1|foo&'bar|g=yes|no}}
+{{#switch:foo|bar|baz=no|*default}}
+{{#switch:none|foo=1|bar=2|#default=no match|baz=3}}
+{{#switch:none|foo=1|bar=2|#default=ignored|baz=3|Second default}}
+{{#switch:|a'b}}
+!! result
+yes
+yes
+no
+
+
+no match
+Second default
+a'b
+
+!!end
+
+!! test
+#switch #default should match next and not last named parameter
+!! input
+<{{#switch: foo | #default | bar = DEF }}>
+<{{#switch: foo | #default | bar = DEF | baz = GHI }}>
+!! result
+<DEF>
+<DEF>
+
+!! end
+
+!! test
+#switch should not match #default as a prefix
+!! input
+<{{#switch: foo | #defaultWTF? = This is crazy }}>
+<{{#switch: foo | #defaultWTF? | bar = This is crazy }}>
+!! result
+<>
+<>
+
+!! end
--
cgit v1.2.3-54-g00ecf