Break out additional test helper.
@@ -346,6 +346,13 @@ func previewAndUpdate(t *testing.T, opts *ProgramTestOptions, dir string, name s
func TestEdits(t *testing.T, opts *ProgramTestOptions, dir string) string {
for i, edit := range opts.EditDirs {
+ dir = TestEdit(t, opts, dir, i, edit)
+ }
+
+ return dir
+}
+
+func TestEdit(t *testing.T, opts *ProgramTestOptions, dir string, i int, edit EditDir) string {
fmt.Fprintf(opts.Stdout, "Applying edit '%v' and rerunning preview and update\n", edit)
var err error
@@ -353,13 +360,12 @@ func TestEdits(t *testing.T, opts *ProgramTestOptions, dir string) string {
if !assert.NoError(t, err, "Expected to apply edit %v atop %v, but got an error %v", edit, dir, err) {
return dir
}
- if err = previewAndUpdate(t, opts, dir, fmt.Sprintf("edit%d", i)); err != nil {
+ if err = previewAndUpdate(t, opts, dir, fmt.Sprintf("edit-%d", i)); err != nil {
return dir
}
if err = performExtraRuntimeValidation(t, opts, edit.ExtraRuntimeValidation, dir); err != nil {
return dir
}
- }
return dir
}
