Debian Codegraph @

tools/metadata/metadata_test.go

raw
1 // Copyright 2023 The go-github AUTHORS. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file.
5
6 package main
7
8 import (
9 "testing"
10 )
11
12 func Test_normalizedOpName(t *testing.T) {
13 for _, td := range []struct {
14 name string
15 want string
16 }{
17 {name: "", want: ""},
18 {name: "get /foo/{id}", want: "GET /foo/*"},
19 {name: "get foo", want: "GET /foo"},
20 } {
21 t.Run(td.name, func(t *testing.T) {
22 got := normalizedOpName(td.name)
23 if got != td.want {
24 t.Errorf("normalizedOpName() = %v, want %v", got, td.want)
25 }
26 })
27 }
28 }