mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-13 01:30:53 +02:00
add multi-line commit integration test
This commit is contained in:
@ -2,6 +2,7 @@ package components
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -56,6 +57,16 @@ func NotContains(target string) *matcher {
|
||||
}}
|
||||
}
|
||||
|
||||
func MatchesRegexp(regexStr string) *matcher {
|
||||
return &matcher{testFn: func(value string) (bool, string) {
|
||||
matched, err := regexp.MatchString(regexStr, value)
|
||||
if err != nil {
|
||||
return false, fmt.Sprintf("Unexpected error parsing regular expression '%s': %s", regexStr, err.Error())
|
||||
}
|
||||
return matched, fmt.Sprintf("Expected '%s' to match regular expression '%s'", value, regexStr)
|
||||
}}
|
||||
}
|
||||
|
||||
func Equals(target string) *matcher {
|
||||
return &matcher{testFn: func(value string) (bool, string) {
|
||||
return target == value, fmt.Sprintf("Expected '%s' to equal '%s'", value, target)
|
||||
|
Reference in New Issue
Block a user