(t *testing.T)
| 214 | } |
| 215 | |
| 216 | func TestSQLiteTruncate(t *testing.T) { |
| 217 | // Test that, if I turn on truncating, the thing actually truncates. |
| 218 | fn, rm := testutil.TempFile(t) |
| 219 | defer rm() |
| 220 | |
| 221 | doOneRound(t, fn, false) |
| 222 | doOneRoundTruncate(t, fn, true, false) |
| 223 | |
| 224 | conn, err := sql.Open("sqlite3", fn) |
| 225 | if err != nil { |
| 226 | t.Fatalf("Cannot open output sqlite3 after running writer. %s", err) |
| 227 | } |
| 228 | defer conn.Close() |
| 229 | |
| 230 | rows, err := conn.Query("SELECT field0, field1, field2 FROM lines") |
| 231 | if err != nil { |
| 232 | t.Fatalf("Cannot select data from sqlite3 after running writer. %s", err) |
| 233 | } |
| 234 | defer rows.Close() |
| 235 | |
| 236 | row_id := 0 |
| 237 | for rows.Next() { |
| 238 | row_id++ |
| 239 | } |
| 240 | |
| 241 | if row_id != 4 { |
| 242 | t.Fatalf("Expected 4 lines to be in sqlite3 file.") |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | func TestSQLitePrePostCommands(t *testing.T) { |
| 247 | // This test adds some pre-run and post-run SQLite commands and tests that |
nothing calls this directly
no test coverage detected