diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-21 12:45:29 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-21 12:45:29 -0400 |
commit | e9213e6d0d94e386462939dfadf7967394af009c (patch) | |
tree | 5194a9a0a844ed6da889e18a949dfc4f13552a43 /Git | |
parent | e38c59dfde89f15c61b4073dcd19b53dfe440e74 (diff) | |
download | git-repair-e9213e6d0d94e386462939dfadf7967394af009c.tar.gz |
better Arbitrary instance for FileSelector
This ensures any file in the repo is chosen, not only one of the first 20.
Diffstat (limited to 'Git')
-rw-r--r-- | Git/Destroyer.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Git/Destroyer.hs b/Git/Destroyer.hs index aae1e9e..a208576 100644 --- a/Git/Destroyer.hs +++ b/Git/Destroyer.hs @@ -47,7 +47,7 @@ instance Arbitrary DamageAction where , AppendGarbage <$> garbage , PrependGarbage <$> garbage , CorruptByte - <$> nonNegative arbitrarySizedIntegral + <$> nonNegative arbitraryBoundedIntegral <*> arbitrary , ScrambleFileMode <$> nonNegative arbitrarySizedIntegral ] @@ -61,7 +61,7 @@ data FileSelector = FileSelector Int deriving (Read, Show) instance Arbitrary FileSelector where - arbitrary = FileSelector <$> nonNegative arbitrarySizedIntegral + arbitrary = FileSelector <$> nonNegative arbitraryBoundedIntegral selectFile :: [FilePath] -> FileSelector -> FilePath selectFile sortedfs (FileSelector n) = sortedfs !! (n `mod` length sortedfs) |