#Define where books are stored !! article MediaWiki:Coll-community book prefix !! text BookNamespace: !! endarticle # Create a standard book !! article BookNamespace:The book !! text == The book == :[[The book/Introduction]] :[[The book/First chapter]] :[[The book/Second chapter]] :[[The book/Third chapter]] :[[The book/Chapter ÁÉÍÓÚ]] :[[The book/References]] !! endarticle #Create some chapters for the standard book !! article The book/Introduction !! text This is an introduction... !! endarticle !! article The book/First chapter !! text This is the chapter 1... !! endarticle !! article The book/Second chapter !! text This is the chapter 2... !! endarticle !! article The book/Third chapter !! text This is the chapter 3... !! endarticle !! article The book/Chapter ÁÉÍÓÚ !! text This is a page whose title has accented characters... !! endarticle !! article The book/References !! text This is a page for references... !! endarticle ### ### Tests for PREVPAGENAME variable ### !!test Book Manager: PREVPAGENAME, given a chapter in the middle of a book !!input {{PREVPAGENAME:The book/Second chapter}} !!result

The book/First chapter

!!end !!test Book Manager: PREVPAGENAME, given the first chapter of a book !!input {{PREVPAGENAME:The book/Introduction}} !!result !!end !!test Book Manager: PREVPAGENAME on middle chapters !! options title=[[The book/Second chapter]] !!input {{PREVPAGENAME}} !!result

The book/First chapter

!!end !!test Book Manager: PREVPAGENAME on first chapter !! options title=[[The book/Introduction]] !!input {{PREVPAGENAME}} !!result !!end !!test Book Manager: PREVPAGENAME with empty parameter !! options title=[[The book/Second chapter]] !!input {{PREVPAGENAME:}} !!result

The book/First chapter

!!end ### ### Tests for PREVPAGENAMEE variable ### !!test Book Manager: PREVPAGENAMEE, given a chapter in the middle of a book !!input {{PREVPAGENAMEE:The book/Second chapter}} !!result

The+book/First+chapter

!!end !!test Book Manager: PREVPAGENAMEE, given the first chapter of a book !!input {{PREVPAGENAMEE:The book/Introduction}} !!result !!end !!test Book Manager: PREVPAGENAMEE on middle chapters !! options title=[[The book/Second chapter]] !!input {{PREVPAGENAMEE}} !!result

The+book/First+chapter

!!end !!test Book Manager: PREVPAGENAMEE on first chapter !! options title=[[The book/Introduction]] !!input {{PREVPAGENAMEE}} !!result !!end !!test Book Manager: PREVPAGENAMEE with empty parameter !! options title=[[The book/Second chapter]] !!input {{PREVPAGENAMEE:}} !!result

The+book/First+chapter

!!end !!test Book Manager: PREVPAGENAMEE, when the previous chapter has accented letters !! options title=[[The book/References]] !!input {{PREVPAGENAMEE:}} !!result

The+book/Chapter+%C3%81%C3%89%C3%8D%C3%93%C3%9A

!!end ### ### Tests for NEXTPAGENAME variable ### !!test Book Manager: NEXTPAGENAME, given a chapter in the middle of a book !!input {{NEXTPAGENAME:The book/Second chapter}} !!result

The book/Third chapter

!!end !!test Book Manager: NEXTPAGENAME, given the last chapter of a book !!input {{NEXTPAGENAME:The book/References}} !!result !!end !!test Book Manager: NEXTPAGENAME on middle chapters !! options title=[[The book/Second chapter]] !!input {{NEXTPAGENAME}} !!result

The book/Third chapter

!!end !!test Book Manager: NEXTPAGENAME, on last chapter !! options title=[[The book/References]] !!input {{NEXTPAGENAME}} !!result !!end !!test Book Manager: NEXTPAGENAME with empty parameter !! options title=[[The book/Second chapter]] !!input {{NEXTPAGENAME:}} !!result

The book/Third chapter

!!end ### ### Tests for NEXTPAGENAMEE variable ### !!test Book Manager: NEXTPAGENAMEE, given a chapter in the middle of a book !!input {{NEXTPAGENAMEE:The book/Second chapter}} !!result

The+book/Third+chapter

!!end !!test Book Manager: NEXTPAGENAMEE, given the last chapter of a book !!input {{NEXTPAGENAMEE:The book/References}} !!result !!end !!test Book Manager: NEXTPAGENAMEE on middle chapters !! options title=[[The book/Second chapter]] !!input {{NEXTPAGENAMEE}} !!result

The+book/Third+chapter

!!end !!test Book Manager: NEXTPAGENAMEE, on last chapter !! options title=[[The book/References]] !!input {{NEXTPAGENAMEE}} !!result !!end !!test Book Manager: NEXTPAGENAMEE with empty parameter !! options title=[[The book/Second chapter]] !!input {{NEXTPAGENAMEE:}} !!result

The+book/Third+chapter

!!end !!test Book Manager: NEXTPAGENAMEE, when the next chapter has accented letters !! options title=[[The book/Third chapter]] !!input {{NEXTPAGENAMEE:}} !!result

The+book/Chapter+%C3%81%C3%89%C3%8D%C3%93%C3%9A

!!end ### ### Tests for ROOTPAGENAME variable ### !!test Book Manager: ROOTPAGENAME, given a title without any "/" !!input {{ROOTPAGENAME:Some page title without bars}} !!result

Some page title without bars

!!end !!test Book Manager: ROOTPAGENAME, given a title with only one "/" !!input {{ROOTPAGENAME:Some page title/With one bar}} !!result

Some page title

!!end !!test Book Manager: ROOTPAGENAME, given a title with two "/" !!input {{ROOTPAGENAME:Some page title/With/Two bars}} !!result

Some page title

!!end !!test Book Manager: ROOTPAGENAME, given a title with lots of "/" !!input {{ROOTPAGENAME:Some page title/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z}} !!result

Some page title

!!end !!test Book Manager: ROOTPAGENAME, in a page whose title doesn't has any "/" !! options title=[[Some page title without bars]] !!input {{ROOTPAGENAME}} !!result

Some page title without bars

!!end !!test Book Manager: ROOTPAGENAME, in a page whose title has accented letters and lots of "/" !! options title=[[Some page title ÁÉÍÓÚ/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z]] !!input {{ROOTPAGENAME}} !!result

Some page title ÁÉÍÓÚ

!!end ### ### Tests for ROOTPAGENAMEE variable ### !!test Book Manager: ROOTPAGENAMEE, given a title without any "/" !!input {{ROOTPAGENAMEE:Some page title without bars}} !!result

Some+page+title+without+bars

!!end !!test Book Manager: ROOTPAGENAMEE, given a title with only one "/" !!input {{ROOTPAGENAMEE:Some page title/With one bar}} !!result

Some+page+title

!!end !!test Book Manager: ROOTPAGENAMEE, given a title with two "/" !!input {{ROOTPAGENAMEE:Some page title/With/Two bars}} !!result

Some+page+title

!!end !!test Book Manager: ROOTPAGENAMEE, given a title with lots of "/" !!input {{ROOTPAGENAMEE:Some page title/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z}} !!result

Some+page+title

!!end !!test Book Manager: ROOTPAGENAMEE, given a title with accented letters and lots of "/" !!input {{ROOTPAGENAMEE:Some page title ÁÉÍÓÚ/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z}} !!result

Some+page+title+%C3%81%C3%89%C3%8D%C3%93%C3%9A

!!end !!test Book Manager: ROOTPAGENAMEE, in a page whose title doesn't has any "/" !! options title=[[Some page title without bars]] !!input {{ROOTPAGENAMEE}} !!result

Some+page+title+without+bars

!!end !!test Book Manager: ROOTPAGENAMEE, in a page whose title has accented letters and lots of "/" !! options title=[[Some page title ÁÉÍÓÚ/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z]] !!input {{ROOTPAGENAMEE}} !!result

Some+page+title+%C3%81%C3%89%C3%8D%C3%93%C3%9A

!!end ### ### Tests for CHAPTERNAME variable ### !!test Book Manager: CHAPTERNAME, given a title without any "/" !!input {{CHAPTERNAME:Some page title without bars}} !!result

Some page title without bars

!!end !!test Book Manager: CHAPTERNAME, given a title with only one "/" !!input {{CHAPTERNAME:Some page title/With one bar}} !!result

With one bar

!!end !!test Book Manager: CHAPTERNAME, given a title with two "/" !!input {{CHAPTERNAME:Some page title/With/Two bars}} !!result

With/Two bars

!!end !!test Book Manager: CHAPTERNAME, given a title with lots of "/" !!input {{CHAPTERNAME:Some page title/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z}} !!result

A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z

!!end !!test Book Manager: CHAPTERNAME, in a page whose title doesn't has any "/" !! options title=[[Some page title without bars]] !!input {{CHAPTERNAME}} !!result

Some page title without bars

!!end !!test Book Manager: CHAPTERNAME, in a page whose title has accented letters and lots of "/" !! options title=[[Some page title ÁÉÍÓÚ/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z]] !!input {{CHAPTERNAME}} !!result

A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z

!!end ### ### Tests for CHAPTERNAMEE variable ### !!test Book Manager: CHAPTERNAMEE, given a title without any "/" !!input {{CHAPTERNAMEE:Some page title without bars}} !!result

Some+page+title+without+bars

!!end !!test Book Manager: CHAPTERNAMEE, given a title with only one "/" !!input {{CHAPTERNAMEE:Some page title/With one bar}} !!result

With+one+bar

!!end !!test Book Manager: CHAPTERNAMEE, given a title with two "/" !!input {{CHAPTERNAMEE:Some page title/With/Two bars}} !!result

With/Two+bars

!!end !!test Book Manager: CHAPTERNAMEE, given a title with lots of "/" !!input {{CHAPTERNAMEE:Some page title/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z}} !!result

A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z

!!end !!test Book Manager: CHAPTERNAMEE, given a title with accented letters and lots of "/" !!input {{CHAPTERNAMEE:Some page title/ÁÉÍÓÚ/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z}} !!result

%C3%81%C3%89%C3%8D%C3%93%C3%9A/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z

!!end !!test Book Manager: CHAPTERNAMEE, in a page whose title doesn't has any "/" !! options title=[[Some page title without bars]] !!input {{CHAPTERNAMEE}} !!result

Some+page+title+without+bars

!!end !!test Book Manager: CHAPTERNAMEE, in a page whose title has accented letters and lots of "/" !! options title=[[Some page title/ÁÉÍÓÚ/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z]] !!input {{CHAPTERNAMEE}} !!result

%C3%81%C3%89%C3%8D%C3%93%C3%9A/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z

!!end ### ### Tests for Special:PrintVersion ### !! test BookManager: Special:PrintVersion is known !! options msg !! input {{#special:PrintVersion}} !! result Special:PrintVersion !! end