1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-25 12:24:47 +02:00

Fix wrong test assertion text

If a `t.FileSystem().FileContent("file.txt", Equals("bla"))` assertion fails
because the file doesn't exist, the error would say

   Expected path 'file.txt' to not exist, but it does

which is very confusing.
This commit is contained in:
Stefan Haller 2024-08-18 11:18:54 +02:00
parent db40653202
commit ccd39bb8ae

View File

@ -30,7 +30,7 @@ func (self *FileSystem) FileContent(path string, matcher *TextMatcher) {
self.assertWithRetries(func() (bool, string) {
_, err := os.Stat(path)
if os.IsNotExist(err) {
return false, fmt.Sprintf("Expected path '%s' to not exist, but it does", path)
return false, fmt.Sprintf("Expected path '%s' to exist, but it does not", path)
}
output, err := os.ReadFile(path)