Files
kms/pkg/mpc/zap_addrs_test.go
zeekay cc986c328d lux/kms: orphan history at f2e793bf8 (was: kms: wire luxfi/mpc as REK backend)
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.
2026-06-07 14:28:09 -07:00

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)
}
})
}
}