aboutsummaryrefslogtreecommitdiffstats
path: root/binapigen/binapigen_test.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-07-22 04:40:55 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-07-22 04:40:55 +0200
commit58da9ac6e691a8c660eb8ca838a154e11da0db68 (patch)
treea1bbda04c6d0621ce0fc20779276620f1820190b /binapigen/binapigen_test.go
parenta155cd438c6558da266c1c5931361ea088b35653 (diff)
Fix binapigen decoding and minor improvements
- fixed allocating byte slices before copying decoded data - simplified encoding functions - several minor improvements Change-Id: I6669424b89eb86333805cb1b57e4551169980cc2 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'binapigen/binapigen_test.go')
-rw-r--r--binapigen/binapigen_test.go17
1 files changed, 17 insertions, 0 deletions
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)
+ }
+ })
+ }
+}