Skip to content

Commit

Permalink
Merge pull request #223 from vania-pooh/master
Browse files Browse the repository at this point in the history
Fixed issue with not matched version if XML platform is empty
  • Loading branch information
vania-pooh authored Jul 17, 2018
2 parents dca7b29 + e5d791e commit 9252740
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (b *ggrBrowsers) find(browser, version string, platform string, excludedHos
platform = b.DefaultPlatform
}
for _, v := range b.Versions {
if strings.HasPrefix(v.Number, version) && strings.HasPrefix(v.Platform, platform) {
if strings.HasPrefix(v.Number, version) && (v.Platform == "" || strings.HasPrefix(v.Platform, platform)) {
version = v.Number
next:
for _, r := range v.Regions {
Expand Down
2 changes: 1 addition & 1 deletion config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestFindDefaultVersion(t *testing.T) {
}

func TestFindVersion(t *testing.T) {
hosts, version, _ := browsersWithMultipleVersions.find("browser", "1.0", "", newSet(), newSet())
hosts, version, _ := browsersWithMultipleVersions.find("browser", "1.0", "LINUX", newSet(), newSet())
AssertThat(t, version, EqualTo{"1.0"})
AssertThat(t, len(hosts), EqualTo{1})
AssertThat(t, hosts[0].Name, EqualTo{"browser-1.0"})
Expand Down

0 comments on commit 9252740

Please sign in to comment.