Skip to content

Commit

Permalink
Clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Oct 4, 2024
1 parent e51f5ce commit 23aa524
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/debezium/converters/bit.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (b BitConverter) ToField(name string) debezium.Field {
FieldName: name,
DebeziumType: debezium.Bits,
Type: debezium.Bytes,
Parameters: map[string]any{"length": b.charMaxLength},
Parameters: map[string]any{"length": fmt.Sprint(b.charMaxLength)},
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/debezium/converters/bit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ func TestBitConverter_ToField(t *testing.T) {
field := NewBitConverter(0).ToField("foo")
assert.Equal(t, "foo", field.FieldName)
assert.Equal(t, "bytes", string(field.Type))
assert.Equal(t, map[string]interface{}{"length": 0}, field.Parameters)
assert.Equal(t, debezium.Bits, field.DebeziumType)
assert.Equal(t, map[string]interface{}{"length": "0"}, field.Parameters)
}
{
// char max size 1
Expand All @@ -27,6 +27,7 @@ func TestBitConverter_ToField(t *testing.T) {
assert.Equal(t, "foo", field.FieldName)
assert.Equal(t, "bytes", string(field.Type))
assert.Equal(t, debezium.Bits, field.DebeziumType)
assert.Equal(t, map[string]interface{}{"length": "5"}, field.Parameters)
}
}

Expand Down

0 comments on commit 23aa524

Please sign in to comment.