mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 02:07:58 +00:00
Add vendor folder to git
This commit is contained in:
parent
66cf5eaafb
commit
183585f56f
6916 changed files with 2629581 additions and 1 deletions
49
vendor/github.com/mailru/easyjson/gen/generator_test.go
generated
vendored
Normal file
49
vendor/github.com/mailru/easyjson/gen/generator_test.go
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
package gen
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCamelToSnake(t *testing.T) {
|
||||
for i, test := range []struct {
|
||||
In, Out string
|
||||
}{
|
||||
{"", ""},
|
||||
{"A", "a"},
|
||||
{"SimpleExample", "simple_example"},
|
||||
{"internalField", "internal_field"},
|
||||
|
||||
{"SomeHTTPStuff", "some_http_stuff"},
|
||||
{"WriteJSON", "write_json"},
|
||||
{"HTTP2Server", "http2_server"},
|
||||
{"Some_Mixed_Case", "some_mixed_case"},
|
||||
{"do_nothing", "do_nothing"},
|
||||
|
||||
{"JSONHTTPRPCServer", "jsonhttprpc_server"}, // nothing can be done here without a dictionary
|
||||
} {
|
||||
got := camelToSnake(test.In)
|
||||
if got != test.Out {
|
||||
t.Errorf("[%d] camelToSnake(%s) = %s; want %s", i, test.In, got, test.Out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestJoinFunctionNameParts(t *testing.T) {
|
||||
for i, test := range []struct {
|
||||
keepFirst bool
|
||||
parts []string
|
||||
out string
|
||||
}{
|
||||
{false, []string{}, ""},
|
||||
{false, []string{"a"}, "A"},
|
||||
{false, []string{"simple", "example"}, "SimpleExample"},
|
||||
{true, []string{"first", "example"}, "firstExample"},
|
||||
{false, []string{"some", "UPPER", "case"}, "SomeUPPERCase"},
|
||||
{false, []string{"number", "123"}, "Number123"},
|
||||
} {
|
||||
got := joinFunctionNameParts(test.keepFirst, test.parts...)
|
||||
if got != test.out {
|
||||
t.Errorf("[%d] joinFunctionNameParts(%v) = %s; want %s", i, test.parts, got, test.out)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue