mirror of
https://github.com/luxfi/kms.git
synced 2026-10-30 16:23:36 +00:00
Squashes all pre-rewrite history into a single root commit. Previous tree: - 14506 commits including upstream Infisical fork history - Multiple merge chains carrying pre-purge content Force-rewrite per disk-space reclamation discipline. GHCR images (1.9.9, 1.9.11) remain immutable; their git lineage is no longer materialized.
33 lines
840 B
Go
33 lines
840 B
Go
package mpc
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestSplitAddrs(t *testing.T) {
|
|
for _, tc := range []struct {
|
|
name string
|
|
in string
|
|
want []string
|
|
}{
|
|
{"empty", "", nil},
|
|
{"single", "mpc-0:9653", []string{"mpc-0:9653"}},
|
|
{"csv", "mpc-0:9653,mpc-1:9663,mpc-2:9673",
|
|
[]string{"mpc-0:9653", "mpc-1:9663", "mpc-2:9673"}},
|
|
{"csv with spaces", "mpc-0:9653 , mpc-1:9663 ,mpc-2:9673",
|
|
[]string{"mpc-0:9653", "mpc-1:9663", "mpc-2:9673"}},
|
|
{"empty entries dropped", "mpc-0:9653,,mpc-2:9673",
|
|
[]string{"mpc-0:9653", "mpc-2:9673"}},
|
|
{"trailing comma", "mpc-0:9653,", []string{"mpc-0:9653"}},
|
|
{"only spaces", " ", nil},
|
|
} {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
got := splitAddrs(tc.in)
|
|
if !reflect.DeepEqual(got, tc.want) {
|
|
t.Fatalf("splitAddrs(%q): got %#v want %#v", tc.in, got, tc.want)
|
|
}
|
|
})
|
|
}
|
|
}
|