1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

Add integration tests for searching/filtering

This commit is contained in:
Jesse Duffield
2023-06-03 16:10:53 +10:00
parent 7d7399a89f
commit 261f30f49c
12 changed files with 540 additions and 26 deletions

View File

@ -10,9 +10,9 @@ type IntMatcher struct {
func (self *IntMatcher) EqualsInt(target int) *IntMatcher {
self.appendRule(matcherRule[int]{
name: fmt.Sprintf("equals '%d'", target),
name: fmt.Sprintf("equals %d", target),
testFn: func(value int) (bool, string) {
return value == target, fmt.Sprintf("Expected '%d' to equal '%d'", value, target)
return value == target, fmt.Sprintf("Expected %d to equal %d", value, target)
},
})
@ -21,9 +21,9 @@ func (self *IntMatcher) EqualsInt(target int) *IntMatcher {
func (self *IntMatcher) GreaterThan(target int) *IntMatcher {
self.appendRule(matcherRule[int]{
name: fmt.Sprintf("greater than '%d'", target),
name: fmt.Sprintf("greater than %d", target),
testFn: func(value int) (bool, string) {
return value > target, fmt.Sprintf("Expected '%d' to greater than '%d'", value, target)
return value > target, fmt.Sprintf("Expected %d to greater than %d", value, target)
},
})
@ -32,9 +32,9 @@ func (self *IntMatcher) GreaterThan(target int) *IntMatcher {
func (self *IntMatcher) LessThan(target int) *IntMatcher {
self.appendRule(matcherRule[int]{
name: fmt.Sprintf("less than '%d'", target),
name: fmt.Sprintf("less than %d", target),
testFn: func(value int) (bool, string) {
return value < target, fmt.Sprintf("Expected '%d' to less than '%d'", value, target)
return value < target, fmt.Sprintf("Expected %d to less than %d", value, target)
},
})