(t *testing.T, iter sgbucket.QueryResultIterator)
| 70 | } |
| 71 | |
| 72 | func queryResultString(t *testing.T, iter sgbucket.QueryResultIterator) string { |
| 73 | if iter == nil { |
| 74 | return "" |
| 75 | } |
| 76 | result := []any{} |
| 77 | var row any |
| 78 | for iter.Next(base.TestCtx(t), &row) { |
| 79 | result = append(result, row) |
| 80 | } |
| 81 | assert.NoError(t, iter.Close()) |
| 82 | j, err := json.Marshal(result) |
| 83 | if !assert.NoError(t, err) { |
| 84 | return "" |
| 85 | } |
| 86 | return string(j) |
| 87 | } |
| 88 | |
| 89 | func assertQueryResults(t *testing.T, expected string, iter sgbucket.QueryResultIterator) { |
| 90 | if actual := queryResultString(t, iter); actual != "" { |
no test coverage detected