public void OrphanTests() { Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{orphan}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{Orphan}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{orphan|date=May 2008}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{Orphan| date = May 2008}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{orphan|date=subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}")); Assert.IsFalse(WikiRegexes.Orphan.IsMatch(@"{{orphanblahblah}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{multiple issues|orphan=June 2010}}")); #if DEBUG Variables.SetProjectLangCode("sv"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsFalse(WikiRegexes.Orphan.IsMatch(@"{{orphan}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{föräldralös}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{Föräldralös}}")); Variables.SetProjectLangCode("ru"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsFalse(WikiRegexes.Orphan.IsMatch(@"{{orphan}}")); Assert.IsTrue(WikiRegexes.Orphan.IsMatch(@"{{изолированная статья}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void InterWikiTestsLinkFAOrder() { #if DEBUG Variables.SetProjectLangCode("ar"); WikiRegexes.MakeLangSpecificRegexes(); string a1 = @"{{DEFAULTSORT:Boleyn, Anne}} ", a2 = @"{{وصلة مقالة مختارة|bs}} {{وصلة مقالة مختارة|no}} {{وصلة مقالة مختارة|sv}} [[bs:Anne Boleyn]] [[br:Anne Boleyn]]"; string b = a2; string c = a1 + a2; Assert.AreEqual(b + "\r\n", parser2.Sorter.Interwikis(ref c), "Ar Link FA order not changed"); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); string e1 = @"{{DEFAULTSORT:Boleyn, Anne}} ", e2 = @"{{Link FA|bs}} {{Link FA|no}} {{Link FA|sv}} [[ar:آن بولين]] [[bs:Anne Boleyn]] [[br:Anne Boleyn]]"; string f = e2; string g = e1 + e2; Assert.AreEqual(f + "\r\n", parser2.Sorter.Interwikis(ref g), "En Link FA order not changed"); #endif }
public void StubTests() { RegexAssert.IsMatch(WikiRegexes.Stub, @"{{footballer-bio-stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{ footballer-bio-stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{ Footballer-Bio-Stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{bio-stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{ stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{Stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{-stub}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{Japan-spacecraft-stub|nocat=yes}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{Japan-spacecraft-stub|date=August 2012}}"); RegexAssert.NoMatch(WikiRegexes.Stub, @"{{now stubborn}}"); RegexAssert.NoMatch(WikiRegexes.Stub, @"{{stubby}}"); RegexAssert.NoMatch(WikiRegexes.Stub, @"{{foo|stub}}"); RegexAssert.NoMatch(WikiRegexes.Stub, @":{{main|stub (electronics)#Short circuited stub|l1=stub}}"); #if DEBUG Variables.SetProjectLangCode("ar"); Variables.Stub = @"[^{}|]*?([Ss]tub|بذرة|بذور)"; WikiRegexes.MakeLangSpecificRegexes(); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{بذرة}}"); RegexAssert.IsMatch(WikiRegexes.Stub, @"{{stub}}"); Variables.SetProject("en", ProjectEnum.wikipedia); Variables.Stub = "[^{}|]*?[Ss]tub"; WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void WikifyTests() { Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{wikify}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{wikify|date=March 2009}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{Wikify}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{Wikify|date=March 2009}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{wikify|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{Article issues|wikify=May 2008|a=b|c=d}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{Articleissues|wikify=May 2008|a=b|c=d}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{articleissues|wikify=May 2008|a=b|c=d}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{article issues|wikify=May 2008|a=b|c=d}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{multiple issues|wikify=May 2008|a=b|c=d}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{multiple issues|wikify={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}|a=b|c=d}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{multiple issues|a=b|c=d| wikify={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}|a=b|c=d}}")); Assert.AreEqual(WikiRegexes.Wikify.Replace(@"{{multiple issues|a=b|c=d|wikify={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}|a=b|c=d}}", "$1"), @"{{multiple issues|a=b|c=d|a=b|c=d}}"); Assert.AreEqual(WikiRegexes.Wikify.Replace(@"{{multiple issues|a=b|c=d|wikify={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}", "$1"), @"{{multiple issues|a=b|c=d}}"); Assert.AreEqual(WikiRegexes.Wikify.Replace(@"{{multiple issues|a=b|c=d|wikify = {{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}", "$1"), @"{{multiple issues|a=b|c=d}}"); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{Article issues|a=b|c=d| wikify = May 2008|a=b|c=d}}")); // don't remove the whole of an {{article issues}} template if removing wikify tag Assert.IsTrue(WikiRegexes.Wikify.Replace(@"{{Article issues|a=b|c=d| wikify = May 2008|a=b|c=d}}", "$1").Contains(@"{{Article issues|a=b|c=d|")); Assert.IsFalse(WikiRegexes.Wikify.IsMatch(@"{{wikifyworldblah}}")); #if DEBUG Variables.SetProjectLangCode("sv"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsFalse(WikiRegexes.Wikify.IsMatch(@"{{wikify}}")); Assert.IsTrue(WikiRegexes.Wikify.IsMatch(@"{{ickewiki}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public HideTextTests() { Globals.UnitTestMode = true; if (WikiRegexes.Category == null) { WikiRegexes.MakeLangSpecificRegexes(); } }
public NamespaceSwitches() { Globals.UnitTestMode = true; if (WikiRegexes.Category == null) { WikiRegexes.MakeLangSpecificRegexes(); } }
public ToolsTests() { Globals.UnitTestMode = true; if (WikiRegexes.Redirect == null) { WikiRegexes.MakeLangSpecificRegexes(); } }
public GenfixesTestsBase() { Globals.UnitTestMode = true; if (WikiRegexes.Category == null) { WikiRegexes.MakeLangSpecificRegexes(); } a.InitialiseLogListener(); }
public SorterTests() { Globals.UnitTestMode = true; Variables.SetToEnglish(); if (WikiRegexes.Category == null) { WikiRegexes.MakeLangSpecificRegexes(); } }
public void GenerateNamespaceRegex() { Assert.AreEqual("", WikiRegexes.GenerateNamespaceRegex(0)); Assert.AreEqual("User", WikiRegexes.GenerateNamespaceRegex(Namespace.User)); Assert.AreEqual("User[ _]talk", WikiRegexes.GenerateNamespaceRegex(Namespace.UserTalk)); Assert.AreEqual("File|Image", WikiRegexes.GenerateNamespaceRegex(Namespace.File)); Assert.AreEqual("Wikipedia|Project", WikiRegexes.GenerateNamespaceRegex(Namespace.Project)); Assert.AreEqual("Media|File|Image", WikiRegexes.GenerateNamespaceRegex(Namespace.Media, Namespace.File)); }
public void LinkFGAsCatalan() { #if DEBUG Variables.SetProjectLangCode("ca"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Enllaç AD|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsEsperando() { #if DEBUG Variables.SetProjectLangCode("eo"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{ligoElstara|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsBasque() { #if DEBUG Variables.SetProjectLangCode("eu"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{FA link|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{NA lotura|el}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsFrench() { #if DEBUG Variables.SetProjectLangCode("fr"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{lien BA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Lien AdQ|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{lien PdQ|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsAragonese() { #if DEBUG Variables.SetProjectLangCode("an"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Destacato|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Destacau|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsVietnamese() { #if DEBUG Variables.SetProjectLangCode("vi"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Liên kết chọn lọc|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{LKCL|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{FA link|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsItalian() { #if DEBUG Variables.SetProjectLangCode("it"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Link AdQ|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link GA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Link VdQ|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsRomanian() { #if DEBUG Variables.SetProjectLangCode("ro"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Link AF|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{legătură AC|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{legătură AF|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsBrezhoneg() { #if DEBUG Variables.SetProjectLangCode("br"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{liamm PuB|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{lien AdQ|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{lien BA|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsSpanish() { #if DEBUG Variables.SetProjectLangCode("es"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Destacado|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Bueno|el}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{bueno|el}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsArabic() { #if DEBUG Variables.SetProjectLangCode("ar"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{وصلة مقالة مختارة|he}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{وصلة مقالة مختارة| he}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{وصلة مقالة مختارة |he}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsPortuguese() { #if DEBUG Variables.SetProjectLangCode("pt"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link GA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Bom interwiki|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Interwiki destacado|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Destaque|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void LinkFGAsSwedish() { #if DEBUG Variables.SetProjectLangCode("sv"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{link GA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{GA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Link FA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{Länk UA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{lank UA|ar}}")); Assert.IsTrue(WikiRegexes.LinkFGAs.IsMatch(@"foo {{UA|ar}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }
public void DateYearMonthParameterTests() { #if DEBUG Variables.SetProjectLangCode("sv"); WikiRegexes.MakeLangSpecificRegexes(); Assert.AreEqual(WikiRegexes.DateYearMonthParameter, @"datum={{subst:CURRENTYEAR}}-{{subst:CURRENTMONTH}}"); Variables.SetProjectLangCode("fr"); WikiRegexes.MakeLangSpecificRegexes(); Assert.AreEqual(WikiRegexes.DateYearMonthParameter, @"date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}"); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif Assert.AreEqual(WikiRegexes.DateYearMonthParameter, @"date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}"); }
public SorterTests() { Globals.UnitTestMode = true; Variables.SetToEnglish(); WikiRegexes.MakeLangSpecificRegexes(); }
public HideTextTests() { Globals.UnitTestMode = true; WikiRegexes.MakeLangSpecificRegexes(); }
public GenfixesTestsBase() { Globals.UnitTestMode = true; WikiRegexes.MakeLangSpecificRegexes(); a.InitialiseLogListener(); }
public RegexTestsBase() { Globals.UnitTestMode = true; WikiRegexes.MakeLangSpecificRegexes(); }
public void UncatTests() { Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncategorized}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncategorised}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorized}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorised}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncat|date=January 2009}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorised|date=May 2008}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncategorised|date=May 2008}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncategorisedstub|date=May 2008}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncategorisedstub|date = May 2008}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorised|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}")); Assert.IsTrue(WikiRegexes.Uncat.Match(@"{{Uncat}}").Groups[1].Value.Equals("Uncat")); // all the other redirects Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Classify}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{CatNeeded}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Catneeded}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncategorised}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Categorize}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Categories needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Categoryneeded}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Category needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Category requested}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Categories requested}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Nocats}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Categorise}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Nocat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncat-date}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Uncategorized-date}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Needs cat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Needs cats}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Cats needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Cat needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{classify}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{catneeded}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{catneeded}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorised}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{categorize}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{categories needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{categoryneeded}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{category needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{category requested}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{categories requested}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{nocats}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{categorise}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{nocat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncat-date}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorized-date}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{needs cat}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{needs cats}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{cats needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{cat needed}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorizedstub}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{uncategorized stub}}")); // no match Assert.IsFalse(WikiRegexes.Uncat.IsMatch(@"{{Uncategorized other template}}")); Assert.IsFalse(WikiRegexes.Uncat.IsMatch(@"{{Uncategorized other template|foo=bar}}")); // language variation #if DEBUG Variables.SetProjectLangCode("sv"); WikiRegexes.MakeLangSpecificRegexes(); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{okategoriserad}}")); Assert.IsTrue(WikiRegexes.Uncat.IsMatch(@"{{Okategoriserad}}")); Variables.SetProjectLangCode("en"); WikiRegexes.MakeLangSpecificRegexes(); #endif }