mkhomedir golden
mkhomedir
mksourcedir

# test that chezmoi verify succeeds
chezmoi verify

# test that chezmoi verify fails when a file is added to the source state
cp golden/dot_newfile $CHEZMOISOURCEDIR/dot_newfile
! chezmoi verify
chezmoi forget --force $HOME${/}.newfile
chezmoi verify

# test that chezmoi verify fails when a file is edited
edit $HOME/.file
! chezmoi verify
chezmoi apply --force $HOME${/}.file
chezmoi verify

# test that chezmoi verify fails when a file is removed from the destination directory
rm $HOME/.file
! chezmoi verify
chezmoi apply --force $HOME${/}.file
chezmoi verify

# test that chezmoi verify fails when a directory is removed from the destination directory
rm $HOME/.dir
! chezmoi verify
mkdir $HOME/.dir
chezmoi apply --force $HOME${/}.dir
chezmoi verify

[windows] stop 'remaining tests use file modes'

# test that chezmoi verify fails when a file's permissions are changed
chmod 777 $HOME/.file
! chezmoi verify
chezmoi apply --force $HOME${/}.file
chezmoi verify

# test that chezmoi verify fails when a directory's permissions are changed
chmod 700 $HOME/.dir
! chezmoi verify
chezmoi apply --force $HOME${/}.dir
chezmoi verify

-- golden/dot_newfile --
# contents of .newfile
