Optimize socketclient adapter and add various code improvements
[govpp.git] / cmd / binapi-generator / definitions_test.go
1 package main
2
3 import (
4         "testing"
5 )
6
7 func TestInitialism(t *testing.T) {
8         tests := []struct {
9                 name      string
10                 input     string
11                 expOutput string
12         }{
13                 {name: "id", input: "id", expOutput: "ID"},
14                 {name: "ipv6", input: "is_ipv6", expOutput: "IsIPv6"},
15                 {name: "ip6", input: "is_ip6", expOutput: "IsIP6"},
16         }
17         for _, test := range tests {
18                 t.Run(test.name, func(t *testing.T) {
19                         output := camelCaseName(test.input)
20                         if output != test.expOutput {
21                                 t.Errorf("expected %q, got %q", test.expOutput, output)
22                         }
23                 })
24         }
25 }