diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-09 10:48:04 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-09 10:48:04 -0400 |
commit | 53170b1a1496084923531046386794c092cc64b3 (patch) | |
tree | 094f40a629aed32b8bb510ba0a6d14506c2bb63e /TypeInternals.hs | |
parent | f4ddb580c83cba1c0e66fc5deb20bfc49ee4cf1b (diff) |
fix real underlaying cause, and fix test suite to not skip it0.17
Diffstat (limited to 'TypeInternals.hs')
-rw-r--r-- | TypeInternals.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/TypeInternals.hs b/TypeInternals.hs index 12a9080b3..44db743fa 100644 --- a/TypeInternals.hs +++ b/TypeInternals.hs @@ -55,7 +55,7 @@ instance Read Key where readsPrec _ s = [(Key (b,k), "")] where l = split ":" s - b = head l + b = if null l then "" else head l k = join ":" $ drop 1 l -- for quickcheck @@ -67,13 +67,9 @@ instance Arbitrary Key where prop_idempotent_key_read_show :: Key -> Bool prop_idempotent_key_read_show k - -- filter out empty key or backend names - -- also backend names will not contain colons - | null kname || null bname || elem ':' bname = True + -- backend names will never contain colons + | elem ':' (backendName k) = True | otherwise = k == (read $ show k) - where - bname = backendName k - kname = keyName k backendName :: Key -> BackendName backendName (Key (b,_)) = b |