Skip to main content

q_test.go

1package q
3import "testing"
5func TestChooseDisplayName(t *testing.T) {
6 for _, tt := range []struct {
7 label string
8 functionName string
9 displayName string
10 }{
11 {
12 label: "test-function",
13 functionName: "tailscale.com/wgengine/magicsock.TestNetworkDownSendErrors",
14 displayName: "TestNetworkDownSendErrors",
15 },
16 {
17 label: "test-function-with-parameters",
18 functionName: "tailscale.com/tstest/integration.TestOneNodeUpAuth.func1",
19 displayName: "TestOneNodeUpAuth",
20 },
21 } {
22 t.Run(tt.label, func(t *testing.T) {
23 if got := chooseDisplayName(tt.functionName); got != tt.displayName {
24 t.Fatalf("wanted: %s, got: %s", tt.displayName, got)
25 }
26 })
28 }