mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
fix: TestExecutable on Windows - expected error message is wrong (#3272)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8b459587ca
commit
d280ab1d6b
@@ -6,6 +6,7 @@
|
||||
package providercache
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
@@ -103,7 +104,7 @@ func TestExecutableFile(t *testing.T) {
|
||||
Version: getproviders.MustParseVersion("2.0.0"),
|
||||
PackageDir: "testdata/cachedir/registry.opentofu.org/missing/packagedir/2.0.0/linux_amd64",
|
||||
},
|
||||
err: "could not read package directory: open testdata/cachedir/registry.opentofu.org/missing/packagedir/2.0.0/linux_amd64: " + syscall.ENOENT.Error(),
|
||||
err: "could not read package directory: open testdata/cachedir/registry.opentofu.org/missing/packagedir/2.0.0/linux_amd64: " + missingDirError(),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -121,3 +122,10 @@ func TestExecutableFile(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func missingDirError() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return syscall.ENOTDIR.Error()
|
||||
}
|
||||
return syscall.ENOENT.Error()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user