Template:If in page/testcases

{{Test case|_collapsible=yes|_showcode=yes|_title=Other page, pattern matches
 * %{%{#invoke:|match|no match|page=Template:Infobox}}

{{Test case|_collapsible=yes|_showcode=yes|_title=Other page, pattern does not match
 * Non ?Matching ?Pattern|match|no match|page=Template:Infobox}}

{{Test case|_collapsible=yes|_showcode=yes|_title=Invalid pattern, can crash
 * %|match|no match}}

{{Test case|_collapsible=yes|_showcode=yes|_title=Leading and trailing whitespace
 * b?b |match|no match}}

{{Test case|_collapsible=yes|_showcode=yes|_title=Leading and trailing whitespace workaround
 * ( b?b )|match|no match}}

{{Test case|_collapsible=yes|_showcode=yes|_title=Bad title
 * pattern|match|no match|page=Talk:Template:If in title}}

{{Test case|_collapsible=yes|_showcode=yes|_title=Non existent page
 * pattern|match|no match|page=This does not exist}}

{{Test case|_collapsible=yes|_showcode=yes|_title=sub=yes
 * (mat)ch|%1|no match|sub=yes}}