Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashay Mittal committed May 2, 2024
1 parent caf1f15 commit 36b6d31
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 33 deletions.
56 changes: 27 additions & 29 deletions codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,70 +145,70 @@ func TestCodecRabin(t *testing.T) {
}
}

func TestTypeName(t* testing.T) {
func TestTypeName(t *testing.T) {
cases := []struct {
Schema string
expectedFullName string
Schema string
expectedFullName string
expectedNamespace string
}{
{
Schema: `"null"`,
expectedFullName: "null",
Schema: `"null"`,
expectedFullName: "null",
expectedNamespace: "",
},
{
Schema: `"boolean"`,
expectedFullName: "boolean",
Schema: `"boolean"`,
expectedFullName: "boolean",
expectedNamespace: "",
},
{
Schema: `"int"`,
expectedFullName: "int",
Schema: `"int"`,
expectedFullName: "int",
expectedNamespace: "",
},
{
Schema: `"long"`,
expectedFullName: "long",
Schema: `"long"`,
expectedFullName: "long",
expectedNamespace: "",
},
{
Schema: `"float"`,
expectedFullName: "float",
Schema: `"float"`,
expectedFullName: "float",
expectedNamespace: "",
},
{
Schema: `[ "int" ]`,
expectedFullName: "union",
Schema: `[ "int" ]`,
expectedFullName: "union",
expectedNamespace: "",
},
{
Schema: `[ "int" , {"type":"boolean"} ]`,
expectedFullName: "union",
Schema: `[ "int" , {"type":"boolean"} ]`,
expectedFullName: "union",
expectedNamespace: "",
},
{
Schema: `{"fields":[], "type":"record", "name":"foo"}`,
expectedFullName: "foo",
Schema: `{"fields":[], "type":"record", "name":"foo"}`,
expectedFullName: "foo",
expectedNamespace: "",
},
{
Schema: `{"type":"enum", "name":"foo", "symbols":["A1"]}`,
expectedFullName: "foo",
Schema: `{"type":"enum", "name":"foo", "symbols":["A1"]}`,
expectedFullName: "foo",
expectedNamespace: "",
},
{
Schema: `{"name":"foo","type":"fixed","size":15}`,
expectedFullName: "foo",
Schema: `{"name":"foo","type":"fixed","size":15}`,
expectedFullName: "foo",
expectedNamespace: "",
},
{
Schema: `{"fields":[], "type":"record", "name":"foo", "namespace":"x.y"}`,
expectedFullName: "foo",
Schema: `{"fields":[], "type":"record", "name":"foo", "namespace":"x.y"}`,
expectedFullName: "foo",
expectedNamespace: "x.y",
},
{
Schema: `{"namespace":"x.y.z", "type":"enum", "name":"foo", "doc":"foo bar", "symbols":["A1", "A2"]}`,
expectedFullName: "foo",
Schema: `{"namespace":"x.y.z", "type":"enum", "name":"foo", "doc":"foo bar", "symbols":["A1", "A2"]}`,
expectedFullName: "foo",
expectedNamespace: "x.y.z",
},
}
Expand All @@ -226,8 +226,6 @@ func TestTypeName(t* testing.T) {
}
}



func TestSingleObjectEncoding(t *testing.T) {
t.Run("int", func(*testing.T) {
schema := `"int"`
Expand Down
7 changes: 3 additions & 4 deletions name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,11 @@ func TestNewNameFromSchemaMap(t *testing.T) {
}
}


func TestShortName(t *testing.T) {
cases := []struct {
name string
name string
namespace string
want string
want string
}{
{"bar", "", "bar"},
{"foo", "org.bar", "foo"},
Expand All @@ -122,4 +121,4 @@ func TestShortName(t *testing.T) {
t.Errorf("GOT: %#v; WANT: %#v", actual, expected)
}
}
}
}

0 comments on commit 36b6d31

Please sign in to comment.