All checks were successful
Test / Create distribution (push) Successful in 52s
Test / Sandbox (push) Successful in 3m30s
Test / Hakurei (push) Successful in 5m40s
Test / Sandbox (race detector) (push) Successful in 6m30s
Test / Hpkg (push) Successful in 7m21s
Test / Hakurei (race detector) (push) Successful in 3m22s
Test / Flake checks (push) Successful in 2m2s
None of these are valid with their zero value, and the implementations assume they are created by the builder methods. They are by all means an implementation detail and exporting them makes no sense. Signed-off-by: Ophestra <cat@gensokyo.uk>
35 lines
737 B
Go
35 lines
737 B
Go
package system
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestChangeHosts(t *testing.T) {
|
|
testCases := []string{"chronos", "keyring", "cat", "kbd", "yonah"}
|
|
for _, tc := range testCases {
|
|
t.Run("append ChangeHosts operation for "+tc, func(t *testing.T) {
|
|
sys := New(t.Context(), 150)
|
|
sys.ChangeHosts(tc)
|
|
(&tcOp{EX11, tc}).test(t, sys.ops, []Op{
|
|
xhostOp(tc),
|
|
}, "ChangeHosts")
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestXHost_String(t *testing.T) {
|
|
testCases := []struct {
|
|
username string
|
|
want string
|
|
}{
|
|
{"chronos", "SI:localuser:chronos"},
|
|
}
|
|
for _, tc := range testCases {
|
|
t.Run(tc.want, func(t *testing.T) {
|
|
if got := xhostOp(tc.username).String(); got != tc.want {
|
|
t.Errorf("String() = %v, want %v", got, tc.want)
|
|
}
|
|
})
|
|
}
|
|
}
|