darcs-2.4: a distributed, interactive, smart revision control systemContentsIndex
Darcs.Test.Patch.Check
Synopsis
type PatchCheck = State KnownState
do_check :: PatchCheck a -> a
file_exists :: String -> PatchCheck Bool
dir_exists :: String -> PatchCheck Bool
remove_file :: String -> PatchCheck Bool
remove_dir :: String -> PatchCheck Bool
create_file :: String -> PatchCheck Bool
create_dir :: String -> PatchCheck Bool
insert_line :: String -> Int -> ByteString -> PatchCheck Bool
delete_line :: String -> Int -> ByteString -> PatchCheck Bool
is_valid :: PatchCheck Bool
do_verbose_check :: PatchCheck a -> a
file_empty :: String -> PatchCheck Bool
check_move :: String -> String -> PatchCheck Bool
modify_file :: String -> (Maybe FileContents -> Maybe FileContents) -> PatchCheck Bool
data FileContents = FC {
fc_lines :: Map Int ByteString
fc_maxline :: Int
}
Documentation
type PatchCheck = State KnownState
PatchCheck is a state monad with a simulated repository state
do_check :: PatchCheck a -> a
file_exists :: String -> PatchCheck Bool
dir_exists :: String -> PatchCheck Bool
remove_file :: String -> PatchCheck Bool
remove_dir :: String -> PatchCheck Bool
create_file :: String -> PatchCheck Bool
create_dir :: String -> PatchCheck Bool
insert_line :: String -> Int -> ByteString -> PatchCheck Bool
delete_line :: String -> Int -> ByteString -> PatchCheck Bool
is_valid :: PatchCheck Bool
Returns true if the current repository state is not inconsistent
do_verbose_check :: PatchCheck a -> a
Run a check, and print the final repository state
file_empty
:: StringName of the file to check
-> PatchCheck Bool
Checks if a file is empty
check_move :: String -> String -> PatchCheck Bool
modify_file :: String -> (Maybe FileContents -> Maybe FileContents) -> PatchCheck Bool
data FileContents
File contents are represented by a map from line numbers to line contents. If for a certain line number, the line contents are Nothing, that means that we are sure that that line exists, but we don't know its contents. We must also store the greatest line number that is known to exist in a file, to be able to exclude the possibility of it being empty without knowing its contents.
Constructors
FC
fc_lines :: Map Int ByteString
fc_maxline :: Int
show/hide Instances
Produced by Haddock version 2.6.0