[windows] skip 'UNIX only'

mkhomedir
mksourcedir

# test that chezmoi merge does a three-way merge
chezmoi merge $HOME${/}.file
stdout ^${HOME@R}/\.file\s+${CHEZMOISOURCEDIR@R}/dot_file\s+${WORK@R}/.*/\.file$

# test that chezmoi merge falls back to a two-way merge when the template is invalid
# FIXME the following test fails
# chezmoi merge $HOME${/}.invalid_template
# stdout ^${HOME@R}/\.invalid_template\s+$CHEZMOISOURCEDIR/dot_invalid_template\.tmpl$

chhome home2/user

# test that chezmoi merge does a three-way merge with the arguments in the configured order
chezmoi merge $HOME${/}.file
stdout ^${CHEZMOISOURCEDIR@R}/dot_file\s+${HOME@R}/\.file\s+${WORK@R}/.*/\.file$

chhome home3/user

# test that chezmoi merge appends the destination, source, and target paths if merge.args does not contain any templates
chezmoi merge $HOME${/}.file
stdout ^arg\s+${HOME@R}/\.file\s+${CHEZMOISOURCEDIR@R}/dot_file\s+${WORK@R}/.*/\.file$

chhome home4/user

# test that chezmoi merge respects .chezmoiroot
chezmoi merge $HOME${/}.file
stdout ^${HOME@R}/\.file\s+${CHEZMOISOURCEDIR@R}/home/dot_file\s+${WORK@R}/.*/\.file$

-- home/user/.config/chezmoi/chezmoi.toml --
[merge]
    command = "echo"
-- home/user/.invalid_template --
-- home/user/.local/share/chezmoi/dot_invalid_template.tmpl --
{{
-- home2/user/.config/chezmoi/chezmoi.toml --
[merge]
    command = "echo"
    args = ["{{ .Source }}", "{{ .Destination }}", "{{ .Target }}"]
-- home2/user/.file --
# destination
-- home2/user/.local/share/chezmoi/dot_file --
# source
-- home3/user/.config/chezmoi/chezmoi.toml --
[merge]
    command = "echo"
    args = ["arg"]
-- home3/user/.local/share/chezmoi/dot_file --
# source
-- home4/user/.config/chezmoi/chezmoi.yaml --
merge:
    command: "echo"
-- home4/user/.file --
# destination
-- home4/user/.local/share/chezmoi/.chezmoiroot --
home
-- home4/user/.local/share/chezmoi/home/dot_file --
# source
