package hst_test

import (
	"testing"

	"hakurei.app/container"
	"hakurei.app/hst"
)

func TestFSDaemon(t *testing.T) {
	t.Parallel()

	checkFs(t, []fsTestCase{
		{"nil", (*hst.FSDaemon)(nil), false, nil, nil, nil, "<invalid>"},
		{"zero", new(hst.FSDaemon), false, nil, nil, nil, "<invalid>"},

		{"pipewire-pulse", &hst.FSDaemon{
			Target: m("/run/user/1971/pulse/native"),
			Exec:   m("/run/current-system/sw/bin/pipewire-pulse"),
			Args:   []string{"-v"},
		}, true, container.Ops{
			&container.DaemonOp{
				Target: m("/run/user/1971/pulse/native"),
				Path:   m("/run/current-system/sw/bin/pipewire-pulse"),
				Args:   []string{"-v"},
			},
		}, m("/run/user/1971/pulse/native"), nil, `daemon:/run/user/1971/pulse/native`},
	})
}
