(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestSqlDriverMessage(t *testing.T) { |
| 95 | msg := datasource.NewSqlDriverMessage(0, vals) |
| 96 | smm := msg.ToMsgMap(colidx) |
| 97 | assert.Equal(t, msg.Vals, smm.Values()) |
| 98 | smm.SetKey("hello") |
| 99 | smm.SetKeyHashed("name") |
| 100 | smm.SetRow(vals) |
| 101 | assert.Equal(t, msg.Vals, smm.Values()) |
| 102 | |
| 103 | smm = datasource.NewSqlDriverMessageMapVals(0, vals, cols) |
| 104 | val, ok := smm.Get("user.id") |
| 105 | assert.True(t, ok) |
| 106 | assert.Equal(t, int64(1), val.Value()) |
| 107 | _, ok = smm.Get("user.notthere") |
| 108 | assert.Equal(t, false, ok) |
| 109 | |
| 110 | row := smm.Row() |
| 111 | assert.Equal(t, 3, len(row)) |
| 112 | } |
| 113 | |
| 114 | func contextReaderTests(ctx expr.ContextReader) func(t *testing.T) { |
| 115 | return func(t *testing.T) { |
nothing calls this directly
no test coverage detected