(t *testing.T, path string, truncate, raw bool)
| 72 | } |
| 73 | |
| 74 | func doOneRoundTruncate(t *testing.T, path string, truncate, raw bool) { |
| 75 | t.Helper() |
| 76 | |
| 77 | writer := makeWriter(t, raw, path, truncate) |
| 78 | |
| 79 | wg := &sync.WaitGroup{} |
| 80 | outch := make(chan baker.OutputRecord) |
| 81 | upch := make(chan string) |
| 82 | |
| 83 | path_seen := false |
| 84 | |
| 85 | wg.Add(1) |
| 86 | go func() { |
| 87 | outch <- baker.OutputRecord{Fields: []string{"val12345", "1500000", "BLAH"}, Record: []byte("rawrecord0")} |
| 88 | outch <- baker.OutputRecord{Fields: []string{"val12345", "1500001", "BLAH"}, Record: []byte("rawrecord1")} |
| 89 | outch <- baker.OutputRecord{Fields: []string{"val12348", "1500005", "BLOH"}, Record: []byte("rawrecord2")} |
| 90 | outch <- baker.OutputRecord{Fields: []string{"val12349", "1500007", "BLUH"}, Record: []byte("rawrecord3")} |
| 91 | close(outch) |
| 92 | for upchpath := range upch { |
| 93 | if upchpath == path { |
| 94 | path_seen = true |
| 95 | } |
| 96 | } |
| 97 | wg.Done() |
| 98 | }() |
| 99 | writer.Run(outch, upch) |
| 100 | close(upch) |
| 101 | wg.Wait() |
| 102 | |
| 103 | if !path_seen { |
| 104 | t.Fatalf("SQLite file was not sent to upch.") |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | func assertRows(t *testing.T, fname string, want [][]string) { |
| 109 | // this helper asserts we're going to find these rows and records in |
no test coverage detected