1 // SPDX-License-Identifier: GPL-3.0-or-later
2 // Copyright (C) 2021-2024 Simon Ruderich
9 "ruderich.org/simon/safcm"
10 "ruderich.org/simon/safcm/testutil"
13 func TestHostInfoRespToGroups(t *testing.T) {
16 resp safcm.MsgInfoResp
42 "with UTF-8: Hello, 世界",
49 "detected_with_spaces",
50 "detected_with_uppercase",
51 "detected_with_utf-8_hello_",
56 "invalid goos/goarch",
58 Goos: " INVALID goos! ",
63 "detected_invalid_goos_",
69 for _, tc := range tests {
70 t.Run(tc.name, func(t *testing.T) {
71 res := hostInfoRespToGroups(tc.resp)
72 testutil.AssertEqual(t, "res", res, tc.exp)