(t *testing.T, r *fstest.Run, dir string)
| 131 | var extras = []string{"apple", "banana", "appleappleapplebanana", "splitbananasplit"} |
| 132 | |
| 133 | func makeTestFiles(t *testing.T, r *fstest.Run, dir string) []fstest.Item { |
| 134 | t.Helper() |
| 135 | n := 0 |
| 136 | // Create test files |
| 137 | items := []fstest.Item{} |
| 138 | for _, c := range alphabet { |
| 139 | var out strings.Builder |
| 140 | for i := range rune(7) { |
| 141 | out.WriteRune(c + i) |
| 142 | } |
| 143 | fileName := path.Join(dir, fmt.Sprintf("%04d-%s.txt", n, out.String())) |
| 144 | fileName = strings.ToValidUTF8(fileName, "") |
| 145 | fileName = strings.NewReplacer(":", "", "<", "", ">", "", "?", "").Replace(fileName) // remove characters illegal on windows |
| 146 | |
| 147 | if debug != "" { |
| 148 | fileName = debug |
| 149 | } |
| 150 | |
| 151 | item := r.WriteObject(context.Background(), fileName, fileName, t1) |
| 152 | r.WriteFile(fileName, fileName, t1) |
| 153 | items = append(items, item) |
| 154 | n++ |
| 155 | |
| 156 | if debug != "" { |
| 157 | break |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | for _, extra := range extras { |
| 162 | item := r.WriteObject(context.Background(), extra, extra, t1) |
| 163 | r.WriteFile(extra, extra, t1) |
| 164 | items = append(items, item) |
| 165 | } |
| 166 | |
| 167 | return items |
| 168 | } |
| 169 | |
| 170 | func deleteDSStore(t *testing.T, r *fstest.Run) { |
| 171 | ctxDSStore, fi := filter.AddConfig(context.Background()) |
no test coverage detected
searching dependent graphs…