-
-
Notifications
You must be signed in to change notification settings - Fork 400
Expand file tree
/
Copy pathvcs_ops_test.go
More file actions
29 lines (22 loc) · 644 Bytes
/
vcs_ops_test.go
File metadata and controls
29 lines (22 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//go:build !integration
// +build !integration
package main
import (
"testing"
"github.com/Jguer/aur"
"github.com/stretchr/testify/require"
"github.com/Jguer/yay/v12/pkg/dep"
)
func TestInfoToInstallInfo(t *testing.T) {
info := infoToInstallInfo([]aur.Pkg{
{Name: "foo", PackageBase: "foo-base"},
{Name: "bar", PackageBase: "bar-base"},
})
require.Len(t, info, 1)
require.Len(t, info[0], 2)
require.Equal(t, &dep.InstallInfo{AURBase: ptr("foo-base"), Source: dep.AUR}, info[0]["foo"])
require.Equal(t, &dep.InstallInfo{AURBase: ptr("bar-base"), Source: dep.AUR}, info[0]["bar"])
}
func ptr(s string) *string {
return &s
}