Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cs50/2019/x/caesar/check50/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,15 @@ def checks_for_handling_non_alpha(self):
def handles_no_argv(self):
"""handles lack of argv[1]"""
self.spawn("./caesar").exit(1)

@check("compiles")
def toomanyargs(self):
"""handles argc > 2"""
self.spawn("./caesar 1 2 3").exit(1)

@check("compiles")
def rejects_non_numeric(self):
"""rejects non-numeric argv[1]"""
self.spawn("./caesar 2a!").exit(1)