From d0d25e7a925973f0591542862b20e12af501a339 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Fri, 11 Sep 2009 15:26:04 -0400 Subject: [PATCH] typo --- unit-testing.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit-testing.html b/unit-testing.html index 80010e3..3e24069 100755 --- a/unit-testing.html +++ b/unit-testing.html @@ -240,7 +240,7 @@ OK >>> roman1.to_roman(9000) 'MMMMMMMMM'
    -
  1. That’s definitely not what you wanted — that’s not even a valid Roman numeral! In fact, each of these numbers is outside the range of acceptable input, but the function returns a bogus value anyway. Silently returning bad values is baaaaaaad; if a program is going to fail, it is far better that it fail quickly and noisily. “Halt and catch fire,” as the saying goes. The Pythonic way to halt and catch fire is to raise an exception. +
  2. That’s definitely not what you wanted — that’s not even a valid Roman numeral! In fact, each of these numbers is outside the range of acceptable input, but the function returns a bogus value anyway. Silently returning bad values is baaaaaaad; if a program is going to fail, it is far better if it fails quickly and noisily. “Halt and catch fire,” as the saying goes. The Pythonic way to halt and catch fire is to raise an exception.

The question to ask yourself is, “How can I express this as a testable requirement?” How’s this for starters: