Skip to content

Commit

Permalink
Stop appending *recent to recent versions in recent methods, as this …
Browse files Browse the repository at this point in the history
…is handled by the menu UI
  • Loading branch information
MatthewJohn committed Jun 7, 2024
1 parent e8e0707 commit 59548d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/recent.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func getRecentVersions(installPath string, product Product) ([]string, error) {
}
var returnedRecentVersions []string
for i := 0; i < maxCount; i++ {
returnedRecentVersions = append(returnedRecentVersions, listOfRecentVersions[i]+" *recent")
returnedRecentVersions = append(returnedRecentVersions, listOfRecentVersions[i])
}
return returnedRecentVersions, nil
}
Expand Down
4 changes: 2 additions & 2 deletions lib/recent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Test_getRecentVersionsForTerraform(t *testing.T) {
t.Error("Unable to get versions from recent file")
}
assert.Equal(t, 5, len(strings))
assert.Equal(t, []string{"1.2.3 *recent", "4.5.6 *recent", "4.5.7 *recent", "4.5.8 *recent", "4.5.9 *recent"}, strings)
assert.Equal(t, []string{"1.2.3", "4.5.6", "4.5.7", "4.5.8", "4.5.9"}, strings)
}

func Test_getRecentVersionsForOpenTofu(t *testing.T) {
Expand All @@ -60,7 +60,7 @@ func Test_getRecentVersionsForOpenTofu(t *testing.T) {
if err != nil {
t.Error("Unable to get versions from recent file")
}
assert.Equal(t, []string{"6.6.6 *recent"}, strings)
assert.Equal(t, []string{"6.6.6"}, strings)
}

func Test_addRecent(t *testing.T) {
Expand Down

0 comments on commit 59548d1

Please sign in to comment.