(t *testing.T)
| 463 | } |
| 464 | |
| 465 | func TestDecodeRow(t *testing.T) { |
| 466 | tests := []struct { |
| 467 | desc string |
| 468 | values []interface{} |
| 469 | want []string |
| 470 | }{ |
| 471 | { |
| 472 | desc: "non-null columns", |
| 473 | values: []interface{}{"foo", 123}, |
| 474 | want: []string{"foo", "123"}, |
| 475 | }, |
| 476 | { |
| 477 | desc: "non-null column and null column", |
| 478 | values: []interface{}{"foo", spanner.NullString{StringVal: "", Valid: false}}, |
| 479 | want: []string{"foo", "NULL"}, |
| 480 | }, |
| 481 | } |
| 482 | for _, test := range tests { |
| 483 | t.Run(test.desc, func(t *testing.T) { |
| 484 | got, err := DecodeRow(createRow(t, test.values)) |
| 485 | if err != nil { |
| 486 | t.Error(err) |
| 487 | } |
| 488 | if !equalStringSlice(got, test.want) { |
| 489 | t.Errorf("DecodeRow(%v) = %v, want = %v", test.values, got, test.want) |
| 490 | } |
| 491 | }) |
| 492 | } |
| 493 | } |
nothing calls this directly
no test coverage detected