Skip to content

Commit

Permalink
Fix function names in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Oct 25, 2023
1 parent a770d14 commit 94adcd0
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 83 deletions.
142 changes: 71 additions & 71 deletions cmd/construct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,78 +21,78 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_checkIfVersionSufficient(t *testing.T) {
assert.True(t, checkIfVersionSufficient("2", ">=", "1"))
assert.True(t, checkIfVersionSufficient("2", ">", "1"))
assert.False(t, checkIfVersionSufficient("1", ">=", "2"))
assert.False(t, checkIfVersionSufficient("1", ">", "2"))
assert.False(t, checkIfVersionSufficient("2", ">", "2"))
assert.True(t, checkIfVersionSufficient("2", ">=", "2"))
assert.True(t, checkIfVersionSufficient("1.2", ">=", "1.2"))
assert.False(t, checkIfVersionSufficient("1.2", ">", "1.2"))
assert.True(t, checkIfVersionSufficient("1.3", ">=", "1.2"))
assert.True(t, checkIfVersionSufficient("1.3", ">", "1.2"))
assert.False(t, checkIfVersionSufficient("1.2", ">=", "1.3"))
assert.False(t, checkIfVersionSufficient("1.2", ">", "1.3"))
assert.False(t, checkIfVersionSufficient("1", ">=", "1.2"))
assert.False(t, checkIfVersionSufficient("1", ">", "1.2"))
assert.True(t, checkIfVersionSufficient("1.2", ">=", "1"))
assert.True(t, checkIfVersionSufficient("1.2", ">", "1"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">=", "1.2.4"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">", "1.2.4"))
assert.True(t, checkIfVersionSufficient("1.2.3", ">=", "1.2.3"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">", "1.2.3"))
assert.True(t, checkIfVersionSufficient("1.2.4", ">=", "1.2.3"))
assert.True(t, checkIfVersionSufficient("1.2.4", ">", "1.2.3"))
assert.False(t, checkIfVersionSufficient("1.2", ">=", "1.2.3"))
assert.False(t, checkIfVersionSufficient("1.2", ">", "1.2.3"))
assert.True(t, checkIfVersionSufficient("1.2.3", ">=", "1.2"))
assert.True(t, checkIfVersionSufficient("1.2.3", ">", "1.2"))
assert.True(t, checkIfVersionSufficient("1.3", ">=", "1.2.3"))
assert.True(t, checkIfVersionSufficient("1.3", ">", "1.2.3"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">=", "1.3"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">", "1.3"))
assert.False(t, checkIfVersionSufficient("1", ">=", "1.2.3"))
assert.False(t, checkIfVersionSufficient("1", ">", "1.2.3"))
assert.True(t, checkIfVersionSufficient("1.2.3", ">=", "1"))
assert.True(t, checkIfVersionSufficient("1.2.3", ">", "1"))
assert.True(t, checkIfVersionSufficient("2", ">=", "1.2.3"))
assert.True(t, checkIfVersionSufficient("2", ">", "1.2.3"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">=", "2"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">", "2"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">=", "1.2.3.5"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">", "1.2.3.5"))
assert.True(t, checkIfVersionSufficient("1.2.3.5", ">=", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("1.2.3.5", ">", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("1.2.3.4", ">=", "1.2.3.4"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">", "1.2.3.4"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">=", "1.2.3.4"))
assert.False(t, checkIfVersionSufficient("1.2.3", ">", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("1.2.3.4", ">=", "1.2.3"))
assert.True(t, checkIfVersionSufficient("1.2.3.4", ">", "1.2.3"))
assert.True(t, checkIfVersionSufficient("1.2.4", ">=", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("1.2.4", ">", "1.2.3.4"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">=", "1.2.4"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">", "1.2.4"))
assert.False(t, checkIfVersionSufficient("1.2", ">=", "1.2.3.4"))
assert.False(t, checkIfVersionSufficient("1.2", ">", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("1.2.3.4", ">=", "1.2"))
assert.True(t, checkIfVersionSufficient("1.2.3.4", ">", "1.2"))
assert.True(t, checkIfVersionSufficient("1.3", ">=", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("1.3", ">", "1.2.3.4"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">=", "1.3"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">", "1.3"))
assert.False(t, checkIfVersionSufficient("1", ">=", "1.2.3.4"))
assert.False(t, checkIfVersionSufficient("1", ">", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("2", ">=", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("2", ">", "1.2.3.4"))
assert.True(t, checkIfVersionSufficient("1.2.3.4", ">=", "1"))
assert.True(t, checkIfVersionSufficient("1.2.3.4", ">", "1"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">=", "2"))
assert.False(t, checkIfVersionSufficient("1.2.3.4", ">", "2"))
func Test_CheckIfVersionSufficient(t *testing.T) {
assert.True(t, CheckIfVersionSufficient("2", ">=", "1"))
assert.True(t, CheckIfVersionSufficient("2", ">", "1"))
assert.False(t, CheckIfVersionSufficient("1", ">=", "2"))
assert.False(t, CheckIfVersionSufficient("1", ">", "2"))
assert.False(t, CheckIfVersionSufficient("2", ">", "2"))
assert.True(t, CheckIfVersionSufficient("2", ">=", "2"))
assert.True(t, CheckIfVersionSufficient("1.2", ">=", "1.2"))
assert.False(t, CheckIfVersionSufficient("1.2", ">", "1.2"))
assert.True(t, CheckIfVersionSufficient("1.3", ">=", "1.2"))
assert.True(t, CheckIfVersionSufficient("1.3", ">", "1.2"))
assert.False(t, CheckIfVersionSufficient("1.2", ">=", "1.3"))
assert.False(t, CheckIfVersionSufficient("1.2", ">", "1.3"))
assert.False(t, CheckIfVersionSufficient("1", ">=", "1.2"))
assert.False(t, CheckIfVersionSufficient("1", ">", "1.2"))
assert.True(t, CheckIfVersionSufficient("1.2", ">=", "1"))
assert.True(t, CheckIfVersionSufficient("1.2", ">", "1"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">=", "1.2.4"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">", "1.2.4"))
assert.True(t, CheckIfVersionSufficient("1.2.3", ">=", "1.2.3"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("1.2.4", ">=", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("1.2.4", ">", "1.2.3"))
assert.False(t, CheckIfVersionSufficient("1.2", ">=", "1.2.3"))
assert.False(t, CheckIfVersionSufficient("1.2", ">", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("1.2.3", ">=", "1.2"))
assert.True(t, CheckIfVersionSufficient("1.2.3", ">", "1.2"))
assert.True(t, CheckIfVersionSufficient("1.3", ">=", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("1.3", ">", "1.2.3"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">=", "1.3"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">", "1.3"))
assert.False(t, CheckIfVersionSufficient("1", ">=", "1.2.3"))
assert.False(t, CheckIfVersionSufficient("1", ">", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("1.2.3", ">=", "1"))
assert.True(t, CheckIfVersionSufficient("1.2.3", ">", "1"))
assert.True(t, CheckIfVersionSufficient("2", ">=", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("2", ">", "1.2.3"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">=", "2"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">", "2"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">=", "1.2.3.5"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">", "1.2.3.5"))
assert.True(t, CheckIfVersionSufficient("1.2.3.5", ">=", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("1.2.3.5", ">", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("1.2.3.4", ">=", "1.2.3.4"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">", "1.2.3.4"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">=", "1.2.3.4"))
assert.False(t, CheckIfVersionSufficient("1.2.3", ">", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("1.2.3.4", ">=", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("1.2.3.4", ">", "1.2.3"))
assert.True(t, CheckIfVersionSufficient("1.2.4", ">=", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("1.2.4", ">", "1.2.3.4"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">=", "1.2.4"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">", "1.2.4"))
assert.False(t, CheckIfVersionSufficient("1.2", ">=", "1.2.3.4"))
assert.False(t, CheckIfVersionSufficient("1.2", ">", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("1.2.3.4", ">=", "1.2"))
assert.True(t, CheckIfVersionSufficient("1.2.3.4", ">", "1.2"))
assert.True(t, CheckIfVersionSufficient("1.3", ">=", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("1.3", ">", "1.2.3.4"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">=", "1.3"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">", "1.3"))
assert.False(t, CheckIfVersionSufficient("1", ">=", "1.2.3.4"))
assert.False(t, CheckIfVersionSufficient("1", ">", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("2", ">=", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("2", ">", "1.2.3.4"))
assert.True(t, CheckIfVersionSufficient("1.2.3.4", ">=", "1"))
assert.True(t, CheckIfVersionSufficient("1.2.3.4", ">", "1"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">=", "2"))
assert.False(t, CheckIfVersionSufficient("1.2.3.4", ">", "2"))
}

func Test_constructOutputPackageList(t *testing.T) {
func Test_ConstructOutputPackageList(t *testing.T) {
var repositoryList = []string{
"https://repo1.example.com/ExampleRepo1",
"https://repo2.example.com/ExampleRepo2",
Expand Down Expand Up @@ -287,7 +287,7 @@ func Test_constructOutputPackageList(t *testing.T) {
},
},
}
outputPackageList := constructOutputPackageList(
outputPackageList := ConstructOutputPackageList(
[]PackageDescription{
{
"package1",
Expand Down
8 changes: 4 additions & 4 deletions cmd/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ func mockedDownloadTextFile(url string, _ map[string]string) (int, int64, string
return 200, 0, ""
}

func Test_downloadDescriptionFiles(t *testing.T) {
descriptionFileList := downloadDescriptionFiles([]string{
func Test_DownloadDescriptionFiles(t *testing.T) {
descriptionFileList := DownloadDescriptionFiles([]string{
"https://gitlab.example.com/api/v4/projects/37706/repository/files/subdirectory%2FDESCRIPTION/raw?ref=v1.3.1",
"https://gitlab.example.com/api/v4/projects/38706/repository/files/subdirectory1%2Fsubdirectory2%2FDESCRIPTION/raw?ref=v1.4.2",
"https://gitlab.example.com/api/v4/projects/30176/repository/files/DESCRIPTION/raw?ref=v0.2.0",
Expand Down Expand Up @@ -285,8 +285,8 @@ func Test_downloadDescriptionFiles(t *testing.T) {
})
}

func Test_downloadPackagesFiles(t *testing.T) {
packagesFiles := downloadPackagesFiles([]string{
func Test_DownloadPackagesFiles(t *testing.T) {
packagesFiles := DownloadPackagesFiles([]string{
"https://repo1.example.com/repo1",
"https://repo2.example.com/repo2",
"https://repo3.example.com/repo3",
Expand Down
8 changes: 4 additions & 4 deletions cmd/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_processPackagesFile(t *testing.T) {
func Test_ProcessPackagesFile(t *testing.T) {
byteValue, err := os.ReadFile("testdata/PACKAGES")
checkError(err)
allPackages := processPackagesFile(string(byteValue))
allPackages := ProcessPackagesFile(string(byteValue))
assert.Equal(t, allPackages,
PackagesFile{
[]PackageDescription{
Expand Down Expand Up @@ -156,7 +156,7 @@ func Test_processPackagesFile(t *testing.T) {
)
}

func Test_parseDescriptionFileList(t *testing.T) {
func Test_ParseDescriptionFileList(t *testing.T) {
byteValue1, err := os.ReadFile("testdata/DESCRIPTION1")
checkError(err)
byteValue2, err := os.ReadFile("testdata/DESCRIPTION2")
Expand All @@ -165,7 +165,7 @@ func Test_parseDescriptionFileList(t *testing.T) {
{string(byteValue1), "GitHub", "", "", "", "", "", "", ""},
{string(byteValue2), "GitHub", "", "", "", "", "", "", ""},
}
allPackages := parseDescriptionFileList(descriptionFileList)
allPackages := ParseDescriptionFileList(descriptionFileList)
assert.Equal(t, allPackages,
[]PackageDescription{
{
Expand Down
4 changes: 2 additions & 2 deletions cmd/renv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_generateRenvLock(t *testing.T) {
renvLock := generateRenvLock([]PackageDescription{
func Test_GenerateRenvLock(t *testing.T) {
renvLock := GenerateRenvLock([]PackageDescription{
{
"package1",
"1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions cmd/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_parseInput(t *testing.T) {
func Test_ParseInput(t *testing.T) {
inputPackageList = "https://raw.githubusercontent.com/insightsengineering/tern/main/DESCRIPTION,https://raw.githubusercontent.com/insightsengineering/rlistings/v0.2.6/DESCRIPTION"
inputRepositoryList = "Repo1=https://repo1.example.com/repo1,Repo2=https://repo2.example.com/repo2,Repo3=https://repo3.example.com/repo3"
packageList, repositoryList, repositoryMap := parseInput()
packageList, repositoryList, repositoryMap := ParseInput()
assert.Equal(t, packageList, []string{
"https://raw.githubusercontent.com/insightsengineering/tern/main/DESCRIPTION",
"https://raw.githubusercontent.com/insightsengineering/rlistings/v0.2.6/DESCRIPTION",
Expand Down

0 comments on commit 94adcd0

Please sign in to comment.