X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapigen%2Fbinapigen_test.go;h=9a25420b34c4fbda039a804570fbbbe763499f61;hb=58da9ac6e691a8c660eb8ca838a154e11da0db68;hp=2fbd163eab1c8d028c4f1352fb0a5c82d9f9b2c5;hpb=a155cd438c6558da266c1c5931361ea088b35653;p=govpp.git diff --git a/binapigen/binapigen_test.go b/binapigen/binapigen_test.go index 2fbd163..9a25420 100644 --- a/binapigen/binapigen_test.go +++ b/binapigen/binapigen_test.go @@ -53,3 +53,20 @@ func TestGenerator(t *testing.T) { }) } } + +func TestSanitize(t *testing.T) { + tests := []struct { + name string + expected string + }{ + {"interface", "interfaces"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + s := sanitizedName(test.name) + if s != test.expected { + t.Fatalf("expected: %q, got: %q", test.expected, s) + } + }) + } +}