-- Unit tests for [[Module:Bad title suggestion]]. Click talk page to run tests.localp=require('Module:UnitTests')functionp:test_basic()self:preprocess_equals_preprocess('{{#invoke:Bad title suggestion|main|>|Foobar>}}','{{Did you mean box|Foobar}}')endfunctionp:test_namespaced()self:preprocess_equals_preprocess('{{#invoke:Bad title suggestion|main|}|Wikipedia:Village pump}}}}','{{Did you mean box|Wikipedia:Village pump}}')endfunctionp:test_pipe()self:preprocess_equals_preprocess('{{#invoke:Bad title suggestion|main|||Main Page|title text}}','{{Did you mean box|Main Page}}')endfunctionp:test_missing()self:preprocess_equals_preprocess('{{#invoke:Bad title suggestion|main|>|This page absolutely does not exist>}}','')endfunctionp:test_category()self:preprocess_equals_preprocess('{{#invoke:Bad title suggestion|main|>|Category:Contents>}}','{{Did you mean box|Category:Contents}}')endfunctionp:test_first_invalid()self:preprocess_equals_preprocess('{{#invoke:Bad title suggestion|main|<|&60;Foobar>}}','')endfunctionp:test_empty()self:preprocess_equals_preprocess('{{#invoke:Bad title suggestion|main|>|}}','')endreturnp