mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-09 01:17:06 +02:00
add commit revert integration test
This commit is contained in:
@ -2,6 +2,7 @@ package components
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
@ -259,3 +260,19 @@ func (self *Assert) assertWithRetries(test func() (bool, string)) {
|
||||
func (self *Assert) Fail(message string) {
|
||||
self.gui.Fail(message)
|
||||
}
|
||||
|
||||
// This does _not_ check the files panel, it actually checks the filesystem
|
||||
func (self *Assert) FileSystemPathPresent(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 *Assert) FileSystemPathNotPresent(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)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user