From 8b7a71d8895e009c8d74a1255299818d54016b48 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Fri, 25 Sep 2009 23:55:35 -0400 Subject: [PATCH] make repeated rules uniform between chapters --- regular-expressions.html | 11 ++++++----- unit-testing.html | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/regular-expressions.html b/regular-expressions.html index 549544b..f384049 100755 --- a/regular-expressions.html +++ b/regular-expressions.html @@ -84,11 +84,12 @@ body{counter-reset:h1 5}

The following are some general rules for constructing Roman numerals:

Checking For Thousands

What would it take to validate that an arbitrary string is a valid Roman numeral? Let’s take it one digit at a time. Since Roman numerals are always written highest to lowest, let’s start with the highest: the thousands place. For numbers 1000 and higher, the thousands are represented by a series of M characters. diff --git a/unit-testing.html b/unit-testing.html index 05826cf..0fbdbc2 100755 --- a/unit-testing.html +++ b/unit-testing.html @@ -705,13 +705,13 @@ OK

As you saw in Case Study: Roman Numerals, there are several simple rules for constructing a Roman numeral, using the letters M, D, C, L, X, V, and I. Let's review the rules: -

    +
+

Thus, one useful test would be to ensure that the from_roman() function should fail when you pass it a string with too many repeated numerals. How many is “too many” depends on the numeral.