mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-07-09 17:28:58 +00:00
fix: make option-like ref test locale-independent
Replace English git error message matching with a locale-agnostic "Error:" prefix check to fix test failures on non-English systems.
This commit is contained in:
parent
9d129e2c10
commit
4a2370f9cd
1 changed files with 2 additions and 2 deletions
|
|
@ -207,8 +207,8 @@ func TestGitGrep_OptionLikeRefDoesNotLaunchPager(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(result, "unable to resolve revision") && !strings.Contains(result, "Not a valid object name") {
|
||||
t.Fatalf("expected invalid revision error, got: %s", result)
|
||||
if !strings.HasPrefix(result, "Error:") {
|
||||
t.Fatalf("expected git error for invalid ref, got: %s", result)
|
||||
}
|
||||
if _, err := os.Stat(proofPath); err == nil {
|
||||
t.Fatal("option-like ref launched pager and created proof file")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue