mirror of
https://github.com/Jguer/yay.git
synced 2026-04-08 07:11:13 +02:00
* Test coverage hardening and parallel-safe refactors Add focused test coverage for under-tested operational paths, edge branches, and make key table-driven suites parallel-safe. Also fixed flaky installer test execution under repeated/parallel runs. * chore: fix goimports ordering for golangci-lint * Test(download): expand integration coverage for download paths Add integration scenarios for force/pull repo updates, repo-only and skip semantics, and direct AUR download/scanner coverage used by getpkgbuild and package preparation. * Test(exe): relax systemd-run path assertion Fix flaky TestBuildGitCmd by accepting an absolute systemd-run path while still asserting the expected binary is used. * Test(text): avoid race in color tests Remove parallel execution from TestColorHash so global UseColor writes do not overlap with color consumers in parallel tests and trigger race detector failures. * fix potential race conditions
27 lines
469 B
Go
27 lines
469 B
Go
//go:build !integration
|
|
// +build !integration
|
|
|
|
package multierror
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestMultiError(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
merr := &MultiError{}
|
|
require.NoError(t, merr.Return())
|
|
|
|
merr.Add(errors.New("first"))
|
|
require.Equal(t, "first", merr.Error())
|
|
require.EqualError(t, merr.Return(), "first")
|
|
|
|
merr.Add(nil)
|
|
merr.Add(errors.New("second"))
|
|
require.Equal(t, "first\nsecond", merr.Error())
|
|
}
|