mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-14 11:23:09 +02:00
27 lines
691 B
Go
27 lines
691 B
Go
package components
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
type FileSystem struct {
|
|
*assertionHelper
|
|
}
|
|
|
|
// This does _not_ check the files panel, it actually checks the filesystem
|
|
func (self *FileSystem) PathPresent(path string) {
|
|
self.assertWithRetries(func() (bool, string) {
|
|
_, err := os.Stat(path)
|
|
return err == nil, fmt.Sprintf("Expected path '%s' to exist, but it does not", path)
|
|
})
|
|
}
|
|
|
|
// This does _not_ check the files panel, it actually checks the filesystem
|
|
func (self *FileSystem) PathNotPresent(path string) {
|
|
self.assertWithRetries(func() (bool, string) {
|
|
_, err := os.Stat(path)
|
|
return os.IsNotExist(err), fmt.Sprintf("Expected path '%s' to not exist, but it does", path)
|
|
})
|
|
}
|