MCPcopy
hub / github.com/dropbox/godropbox / TestConvertAssignRowLengthMismatch

Function TestConvertAssignRowLengthMismatch

database/sqltypes/sqltypes_test.go:381–411  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

379}
380
381func TestConvertAssignRowLengthMismatch(t *testing.T) {
382 var err error
383
384 row := make([]Value, 4, 4)
385 row[0], err = BuildValue(int(123))
386 if err != nil {
387 t.Errorf("%v", err)
388 }
389 row[1], err = BuildValue(int64(-1))
390 if err != nil {
391 t.Errorf("%v", err)
392 }
393 row[2], err = BuildValue("abcd")
394 if err != nil {
395 t.Errorf("%v", err)
396 }
397
398 row[3], err = BuildValue([]byte("fdsa"))
399 if err != nil {
400 t.Errorf("%v", err)
401 }
402
403 var n32 int
404 var n64 int64
405 var str string
406
407 err = ConvertAssignRow(row, &n32, &n64, &str)
408 if err == nil {
409 t.Errorf("Expecting error")
410 }
411}
412
413// Ensure DONTESCAPE is not escaped
414func TestEncode(t *testing.T) {

Callers

nothing calls this directly

Calls 2

BuildValueFunction · 0.85
ConvertAssignRowFunction · 0.85

Tested by

no test coverage detected