mirror of
https://github.com/Jguer/yay
synced 2024-08-31 05:39:29 +00:00
48 lines
1.7 KiB
Go
48 lines
1.7 KiB
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/Morganamilo/go-pacmanconf"
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/Jguer/yay/v10/pkg/settings"
|
|
)
|
|
|
|
func TestPacmanConf(t *testing.T) {
|
|
expectedPacmanConf := &pacmanconf.Config{RootDir: "/",
|
|
DBPath: "//var/lib/pacman/",
|
|
CacheDir: []string{"/cachedir/", "/another/"},
|
|
HookDir: []string{"/hookdir/"},
|
|
GPGDir: "/gpgdir/",
|
|
LogFile: "/logfile",
|
|
HoldPkg: []string(nil),
|
|
IgnorePkg: []string{"ignore", "this", "package"},
|
|
IgnoreGroup: []string{"ignore", "this", "group"},
|
|
Architecture: "8086",
|
|
XferCommand: "",
|
|
NoUpgrade: []string{"noupgrade"},
|
|
NoExtract: []string{"noextract"},
|
|
CleanMethod: []string{"KeepInstalled"},
|
|
SigLevel: []string{"PackageOptional", "PackageTrustedOnly", "DatabaseOptional", "DatabaseTrustedOnly"},
|
|
LocalFileSigLevel: []string(nil),
|
|
RemoteFileSigLevel: []string(nil),
|
|
UseSyslog: false,
|
|
Color: false,
|
|
UseDelta: 0,
|
|
TotalDownload: true,
|
|
CheckSpace: true,
|
|
VerbosePkgLists: true,
|
|
DisableDownloadTimeout: false,
|
|
Repos: []pacmanconf.Repository{
|
|
{Name: "repo1", Servers: []string{"repo1"}, SigLevel: []string(nil), Usage: []string{"All"}},
|
|
{Name: "repo2", Servers: []string{"repo2"}, SigLevel: []string(nil), Usage: []string{"All"}}}}
|
|
|
|
pacmanConf, color, err := initAlpm(settings.MakeArguments(), "testdata/pacman.conf")
|
|
assert.Nil(t, err)
|
|
assert.NotNil(t, pacmanConf)
|
|
assert.Equal(t, color, false)
|
|
assert.EqualValues(t, expectedPacmanConf, pacmanConf)
|
|
|
|
}
|