Encode bigints as strings

This commit is contained in:
Dan Sosedoff
2016-01-07 11:27:16 -06:00
parent 581a2f164b
commit fbb8ffbfc6
3 changed files with 37 additions and 0 deletions

View File

@@ -7,6 +7,23 @@ import (
"github.com/stretchr/testify/assert"
)
func Test_PrepareBigints(t *testing.T) {
result := Result{
Columns: []string{"value"},
Rows: []Row{
Row{int(1234)},
Row{int64(9223372036854775807)},
Row{int64(-9223372036854775808)},
},
}
result.PrepareBigints()
assert.Equal(t, 1234, result.Rows[0][0])
assert.Equal(t, "9223372036854775807", result.Rows[1][0])
assert.Equal(t, "-9223372036854775808", result.Rows[2][0])
}
func Test_CSV(t *testing.T) {
result := Result{
Columns: []string{"id", "name", "email"},