diff --git a/index_test.go b/index_test.go
index 73853d7..d078497 100644
--- a/index_test.go
+++ b/index_test.go
@@ -63,30 +63,30 @@ func TestLoadIndexXML(t *testing.T) {
{
`
- `,
- Index{
- Repo: Repo{
- Name: "Foo",
- Version: 14,
- },
- },
- },
- {
- `
-
foo.bar
Foo bar
+
+ 1.0
+ 1
+
`,
Index{
Repo: Repo{
Name: "Foo",
+ Version: 14,
},
Apps: []App{
{
ID: "foo.bar",
Name: "Foo bar",
+ Apks: []Apk{
+ {
+ VName: "1.0",
+ VCode: 1,
+ },
+ },
},
},
},
@@ -94,11 +94,20 @@ func TestLoadIndexXML(t *testing.T) {
}
for _, c := range tests {
r := strings.NewReader(c.in)
- got, err := LoadIndexXML(r)
+ index, err := LoadIndexXML(r)
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
- if !reflect.DeepEqual(*got, c.want) {
+ got := *index
+ for i := range c.want.Apps {
+ app := &c.want.Apps[i]
+ for i := range app.Apks {
+ apk := &app.Apks[i]
+ apk.Repo = &got.Repo
+ apk.App = app
+ }
+ }
+ if !reflect.DeepEqual(got, c.want) {
t.Fatalf("Unexpected index.\nGot:\n%v\nWant:\n%v\n",
got, c.want)
}