package gotool import ( "path/filepath" "testing" ) func TestRecoveryFallbackExecutableLifetime(t *testing.T) { for _, test := range []struct { path string temporary bool }{ {filepath.Join("tmp", "go-build123456", "b001", "exe", "releasekit"), true}, {filepath.Join("cache", "go-build", "hash-d", "releasekit"), false}, {filepath.Join("tmp", "tools", "releasekit"), false}, {filepath.Join("workspace", "go-build-project", "b001", "exe", "releasekit"), false}, } { if got := TemporaryExecutable(test.path); got != test.temporary { t.Errorf("temporary executable %q = %t, want %t", test.path, got, test.temporary) } } }