import (
"fmt"
"os"
+ "path/filepath"
"reflect"
"testing"
for _, tc := range tests {
t.Run(tc.path, func(t *testing.T) {
- err := os.Chdir(tc.path)
+ err := os.Chdir(filepath.Join(cwd, tc.path))
if err != nil {
t.Fatal(err)
}
t.Errorf("err = %#v, want %#v",
err, tc.expErr)
}
-
- err = os.Chdir(cwd)
- if err != nil {
- t.Fatal(err)
- }
})
}
}