Merge pull request #3889 from sylr/fix-tests-macos

Fix api tests on MacOS
This commit is contained in:
Jeff Regan
2021-05-13 15:22:18 -07:00
committed by GitHub

View File

@@ -102,7 +102,10 @@ func (th *HarnessEnhanced) MkDir(path string) string {
func (th *HarnessEnhanced) Reset() {
if th.shouldWipeLdrRoot {
if !strings.HasPrefix(th.ldr.Root(), os.TempDir()) {
root, _ := filepath.EvalSymlinks(th.ldr.Root())
tmpdir, _ := filepath.EvalSymlinks(os.TempDir())
if !strings.HasPrefix(root, tmpdir) {
// sanity check.
panic("something strange about th.ldr.Root() = " + th.ldr.Root())
}