Debian Codegraph @

internal/event/keys/util_test.go

raw symbols SCIP
1 // Copyright 2023 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package keysscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/event/keys`/
6
7 import "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/"
8
9 func TestJoinscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/event/keys`/TestJoin().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
10 type T string
11 type S []T
12
13 tests := []struct {
14 data S
15 want string
16 }{
17 {S{"a", "b", "c"}, "a,b,c"},
18 {S{"b", "a", "c"}, "a,b,c"},
19 {S{"c", "a", "b"}, "a,b,c"},
20 {nil, ""},
21 {S{}, ""},
22 }
23
24 for _, test := range tests {
25 if got := Joinscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/event/keys`/Join().(test.data); got != test.want {
26 t.Errorfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Errorf().("Join(%v) = %q, want %q", test.data, got, test.want)
27 }
28 }
29 }