Module talk:Namespace detect/testcases

From Miranda NG
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

5 tests failed.

test_bad_titles:

Text Expected Actual
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | page = Talk:Square [[brackets]] aren't allowed in page titles}}

Other pages text. Other pages text.

test_multiple_word_namespaces:

Text Expected Actual
Template:Cross {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | education program = Education Program pages text. | other = Other pages text. | page = Education Program:Foo}}

Education Program pages text. Article text.

test_new:

Text Expected Actual
Template:Tick {{#invoke:Namespace detect|main}}
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = | user = User page text. | other = Other pages text. | page = User talk:Example/test}}

Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = | user = User page text. | other = Other pages text. | page = User:Example/test}}

User page text. User page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| TALK = Talk page text. | user = User page text. | other = Other pages text. | page = User talk:Example/test}}

Other pages text. Other pages text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | other = Other pages text. | page = User talk:Example/test}}

talk page text with a delete character here: "?" talk page text with a delete character here: "?"
Template:Cross {{#invoke:Namespace detect|main| main = Article text.

| talk = Talk page text. | wikipedia = Wikipedia page text. | user = User page text. | other = Other pages text. | demospace = Wikipedia }}

Wikipedia page text. Other pages text.
Template:Tick {{#invoke:Namespace detect|main| main =

| talk = talk page text with a delete character here: "?" | user = User page text. | other = Other pages text. | page = Foo}}

Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = | other = Other pages text. | page = User:Example/test}}

Template:Cross {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | book = Book page text. | other = Other pages text. | page = Book:Foo}}

Book page text. Article text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | image = Image page text. | other = Other pages text. | page = File:Foo}}

Image page text. Image page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | file = File page text. | other = Other pages text. | page = File:Foo}}

File page text. File page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | image = | other = Other pages text. | page = File:Foo}}

Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | file = | other = Other pages text. | page = File:Foo}}

Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | mediawiki = MediaWiki page text. | other = Other pages text. | page = MediaWiki:Foo}}

MediaWiki page text. MediaWiki page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | template = Template page text. | other = Other pages text. | page = Template:Foo}}

Template page text. Template page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | help = Help page text. | image = Image page text. | other = Other pages text. | page = Help:Foo}}

Help page text. Help page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | category = Category page text. | other = Other pages text. | page = Category:Foo}}

Category page text. Category page text.
Template:Cross {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | portal = Portal page text. | other = Other pages text. | page = Portal:Foo}}

Portal page text. Article text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | nonexistent = Nonexistent namespace page text. | other = Other pages text. | page = Nonexistent:Foo}}

Article text. Article text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = talk page text with a delete character here: "?" | user = User page text. | nonexistent = Nonexistent namespace page text. | other = Other pages text. | demospace = Nonexistent}}

Other pages text. Other pages text.

test_returning_false:

Text Expected Actual
Template:Tick Return false from article false false
Template:Tick Return false from talk page false false
Template:Tick Return false from category page false false
Template:Tick Return false from other page false false

test_subject_namespaces:

Text Expected Actual
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | page = Talk:Foo}}

Any talk page text. Any talk page text.
Template:Tick {{#invoke:Namespace detect|main| subjectns = yes

| main = Article text. | talk = Any talk page text. | user = User page text. | other = Other pages text. | page = Talk:Foo}}

Article text. Article text.
Template:Tick {{#invoke:Namespace detect|main| subjectns = no

| main = Article text. | talk = Any talk page text. | user = User page text. | other = Other pages text. | page = Talk:Foo}}

Any talk page text. Any talk page text.
Template:Cross {{#invoke:Namespace detect|main| subjectns = yes

| main = Article text. | talk = Any talk page text. | user = User page text. | other = Other pages text. | page = Wikipedia talk:Foo}}

Other pages text. Article text.

test_template_testcases_page:

Text Expected Actual
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text.}}

Any talk page text. Any talk page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | demospace = }}

Any talk page text. Any talk page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | demospace = main}}

Article text. Article text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | demospace = talk}}

Any talk page text. Any talk page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | demospace = help talk}}

Other pages text. Other pages text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | page = }}

Any talk page text. Any talk page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | page = Example/test}}

Article text. Article text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | page = User:Example/test}}

User page text. User page text.
Template:Tick {{#invoke:Namespace detect|main| main = Article text.

| talk = Any talk page text. | user = User page text. | other = Other pages text. | page = User talk:Example/test}}

Any talk page text. Any talk page text.