mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-04 23:45:34 +00:00
b7e5122226
Updates #11682 Signed-off-by: Percy Wegmann <percy@tailscale.com>
27 lines
548 B
Go
27 lines
548 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package osuser
|
|
|
|
import (
|
|
"slices"
|
|
"testing"
|
|
)
|
|
|
|
func TestParseGroupIds(t *testing.T) {
|
|
tests := []struct {
|
|
in string
|
|
expected []string
|
|
}{
|
|
{"5000\x005001\n", []string{"5000", "5001"}},
|
|
{"5000\n", []string{"5000"}},
|
|
{"\n", []string{""}},
|
|
}
|
|
for _, test := range tests {
|
|
actual := parseGroupIds([]byte(test.in))
|
|
if !slices.Equal(actual, test.expected) {
|
|
t.Errorf("parseGroupIds(%q) = %q, wanted %s", test.in, actual, test.expected)
|
|
}
|
|
}
|
|
}
|