1
0
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:
Jesse Duffield
2022-12-20 22:31:59 +11:00
parent b40190bd94
commit bc4ace8357
30 changed files with 55 additions and 67 deletions

View File

@ -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)
})
}