1
0
Fork 0
mirror of https://github.com/imjasonh/csvstruct synced 2026-07-09 19:36:41 +00:00

support uints

This commit is contained in:
Jason Hall 2014-05-15 12:20:41 -04:00
parent f70eb22586
commit 9d07ca61c9
2 changed files with 11 additions and 4 deletions

View file

@ -96,15 +96,16 @@ func TestDecode_NonStrings(t *testing.T) {
type row struct {
Int int
Int64 int64
Uint64 uint64
Float64 float64
Bool bool
}
var r row
if err := NewDecoder(strings.NewReader(`Int,Int64,Float64,Bool
123,123456789,123.456,true`)).DecodeNext(&r); err != nil {
if err := NewDecoder(strings.NewReader(`Int,Int64,Uint64,Float64,Bool
123,-123456789,123456789,123.456,true`)).DecodeNext(&r); err != nil {
t.Errorf("unexpected error: %v", err)
}
exp := row{123, 123456789, 123.456, true}
exp := row{123, -123456789, 123456789, 123.456, true}
if !reflect.DeepEqual(r, exp) {
t.Errorf("unexpected results, got %v, want %v", r, exp)
}