//go:build windows

package deploy

import (
	"strings"
	"testing"
)

func TestHostBinaryCandidatesSSH(t *testing.T) {
	paths := HostBinaryCandidates("ssh")
	for _, p := range paths {
		if !strings.HasSuffix(strings.ToLower(p), "ssh.exe") {
			t.Fatalf("unexpected ssh path: %q", p)
		}
	}
}

func TestHostBinaryCandidatesCustom(t *testing.T) {
	paths := HostBinaryCandidates(`custom:C:\Windows\System32\notepad.exe`)
	if len(paths) != 1 || !strings.HasSuffix(paths[0], "notepad.exe") {
		t.Fatalf("custom: %v", paths)
	}
}

func TestHostBinaryMarkerPaths(t *testing.T) {
	target := `C:\Windows\System32\ftp.exe`
	if got := hostBinaryMarkerPath(target); !strings.HasSuffix(got, hostBinaryProxySuffix) {
		t.Fatalf("marker: %q", got)
	}
	if got := hostBinaryBackupPath(target); !strings.HasSuffix(got, hostBinaryBackupSuffix) {
		t.Fatalf("backup: %q", got)
	}
}
