(t *testing.T, raw bool)
| 158 | func TestSQLiteRawInsertRows(t *testing.T) { testSQLiteInsertRows(t, true) } |
| 159 | |
| 160 | func testSQLiteInsertRows(t *testing.T, raw bool) { |
| 161 | // This test tests that the lines fed into the output actually |
| 162 | // show up in the output file. raw indicates whether the SQLWriter |
| 163 | // is a raw one, in which case we also want to test that raw log lines |
| 164 | // have been inserted, in addition to the set of fields. |
| 165 | fn, rm := testutil.TempFile(t) |
| 166 | defer rm() |
| 167 | |
| 168 | doOneRound(t, fn, raw) |
| 169 | |
| 170 | var want [][]string |
| 171 | want = append(want, []string{"val12345", "1500000", "BLAH"}) |
| 172 | want = append(want, []string{"val12345", "1500001", "BLAH"}) |
| 173 | want = append(want, []string{"val12348", "1500005", "BLOH"}) |
| 174 | want = append(want, []string{"val12349", "1500007", "BLUH"}) |
| 175 | |
| 176 | if raw { |
| 177 | for i := range want { |
| 178 | want[i] = append(want[i], fmt.Sprintf("rawrecord%d", i)) |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | assertRows(t, fn, want) |
| 183 | } |
| 184 | |
| 185 | func TestSQLiteNoTruncate(t *testing.T) { |
| 186 | // Tests that running the output twice doesn't truncate the table |
no test coverage detected