mkhomedir golden
mksourcedir

# test that chezmoi apply does not create symlinks by default
chezmoi apply
cmp $HOME/.create golden/.create
! issymlink $HOME/.create
cmp $HOME/.dir/file golden/.dir/file
! issymlink $HOME/.dir/file
cmp $HOME/.dir/subdir/file golden/.dir/subdir/file
! issymlink $HOME/.dir/subdir/file
cmp $HOME/.empty golden/.empty
! issymlink $HOME/.empty
cmp $HOME/.executable golden/.executable
! issymlink $HOME/.executable
cmp $HOME/.file golden/.file
! issymlink $HOME/.file
cmp $HOME/.private golden/.private
! issymlink $HOME/.private
! exists $HOME/.remove
cmp $HOME/.template golden/.template
! issymlink $HOME/.template

# test that chezmoi apply --mode=symlink creates symlinks where possible
chezmoi apply --mode=symlink
cmp $HOME/.create golden/.create
! issymlink $HOME/.create
cmp $HOME/.dir/file golden/.dir/file
issymlink $HOME/.dir/file
cmp $HOME/.dir/subdir/file golden/.dir/subdir/file
issymlink $HOME/.dir/subdir/file
cmp $HOME/.empty golden/.empty
issymlink $HOME/.empty
cmp $HOME/.executable golden/.executable
! issymlink $HOME/.executable
cmp $HOME/.file golden/.file
issymlink $HOME/.file
cmp $HOME/.private golden/.private
! issymlink $HOME/.private
! exists $HOME/.remove
cmp $HOME/.template golden/.template
! issymlink $HOME/.template
