Adds checks for null search terms and dbref range.
This commit is contained in:
parent
5339b80743
commit
54b2572538
2 changed files with 4 additions and 1 deletions
|
|
@ -2768,7 +2768,7 @@ class CmdFind(COMMAND_DEFAULT_CLASS):
|
||||||
caller = self.caller
|
caller = self.caller
|
||||||
switches = self.switches
|
switches = self.switches
|
||||||
|
|
||||||
if not self.args:
|
if not self.args or (not self.lhs and not self.rhs):
|
||||||
caller.msg("Usage: find <string> [= low [-high]]")
|
caller.msg("Usage: find <string> [= low [-high]]")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1215,6 +1215,9 @@ class TestBuilding(CommandTest):
|
||||||
self.call(building.CmdFind(), "/exit Obj")
|
self.call(building.CmdFind(), "/exit Obj")
|
||||||
self.call(building.CmdFind(), "/exact Obj", "One Match")
|
self.call(building.CmdFind(), "/exact Obj", "One Match")
|
||||||
|
|
||||||
|
# Test null search
|
||||||
|
self.call(building.CmdFind(), "=", "Usage: ")
|
||||||
|
|
||||||
# Test bogus dbref range with no search term
|
# Test bogus dbref range with no search term
|
||||||
self.call(building.CmdFind(), "= obj", "Invalid dbref range provided (not a number).")
|
self.call(building.CmdFind(), "= obj", "Invalid dbref range provided (not a number).")
|
||||||
self.call(building.CmdFind(), "= #1a", "Invalid dbref range provided (not a number).")
|
self.call(building.CmdFind(), "= #1a", "Invalid dbref range provided (not a number).")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue