diff --git a/manifest/example_test.go b/manifest/example_test.go index c98dd71..e6dd267 100644 --- a/manifest/example_test.go +++ b/manifest/example_test.go @@ -54,10 +54,18 @@ s390x-GitCommit: b6c460e7cd79b595267870a98013ec3078b490df i386-GitFetch: refs/heads/i386 ppc64le-Directory: 1.5/ppc64le +Tags: 1.5-alpine +GitCommit: d7e2a8d90a9b8f5dfd5bcd428e0c33b68c40cc19 +Directory: 1.5 +File: Dockerfile.alpine +s390x-File: Dockerfile.alpine.s390x.bad-boy + SharedTags: raspbian GitCommit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef Tags: raspbian-s390x Architectures: s390x, i386 +File: Dockerfile-raspbian +s390x-File: Dockerfile `))) @@ -113,15 +121,24 @@ i: g@h j // ppc64le-Directory: 1.5/ppc64le // s390x-GitCommit: b6c460e7cd79b595267870a98013ec3078b490df // + // Tags: 1.5-alpine + // GitCommit: d7e2a8d90a9b8f5dfd5bcd428e0c33b68c40cc19 + // Directory: 1.5 + // File: Dockerfile.alpine + // s390x-File: Dockerfile.alpine.s390x.bad-boy + // // Tags: raspbian-s390x // SharedTags: raspbian // Architectures: i386, s390x // GitCommit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef + // File: Dockerfile-raspbian + // s390x-File: Dockerfile // // Shared Tag Groups: // // - latest // - 1.6.1, 1.6, 1 + // - 1.5-alpine // // - 1.5.3-debian, 1.5-debian // - 1.5.3, 1.5 diff --git a/manifest/parse_test.go b/manifest/parse_test.go index 17cb446..02a2e4a 100644 --- a/manifest/parse_test.go +++ b/manifest/parse_test.go @@ -18,48 +18,3 @@ func TestParseError(t *testing.T) { t.Errorf("Unexpected error: %v", err) } } - -func TestArchFile(t *testing.T) { - tests := []struct { - file string - arch string - expectedFile string - }{{ - file: "", - arch: manifest.DefaultArchitecture, - expectedFile: "Dockerfile", - }, { - file: "Dockerfile", - arch: manifest.DefaultArchitecture, - expectedFile: "Dockerfile", - }, { - file: "Dockerfile-foo", - arch: manifest.DefaultArchitecture, - expectedFile: "Dockerfile-foo", - }, { - file: "Dockerfile-i386", - arch: "i386", - expectedFile: "Dockerfile-i386", - }, - } - - for _, test := range tests { - manString := `Maintainers: Giuseppe Valente (@7AC) -GitCommit: abcdef -` - if test.arch != manifest.DefaultArchitecture { - manString += test.arch + "-" - } - if test.file != "" { - manString += "File: " + test.file - } - man, err := manifest.Parse2822(strings.NewReader(manString)) - if err != nil { - t.Fatalf("Unexpected error: %v", err) - } - actualFile := man.Global.ArchFile(test.arch) - if actualFile != test.expectedFile { - t.Fatalf("Unexpected arch file: %s (expected %q)", actualFile, test.expectedFile) - } - } -}