nixbuild/format_test.go

25 lines
565 B
Go

package nixbuild_test
import (
"testing"
"git.gensokyo.uk/yonah/nixbuild"
)
func TestInstallable(t *testing.T) {
testCases := []struct {
name, flake, host, want string
}{
{"satori", "/var/lib/persist/nixos", "satori", "/var/lib/persist/nixos#nixosConfigurations.satori.config.system.build.toplevel"},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
got := nixbuild.NixOSInstallable(tc.flake, tc.host)
if got != tc.want {
t.Errorf("Installable(%q, %q): %q, want %q",
tc.flake, tc.host, got, tc.want)
}
})
}
}