Skip to content

Commit

Permalink
test(version): check if the current version is parsable (#1417)
Browse files Browse the repository at this point in the history
  • Loading branch information
b00f authored Jul 16, 2024
1 parent 37c1e76 commit e1f8e41
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/pactus-project/pactus/version"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestVersionString(t *testing.T) {
Expand Down Expand Up @@ -166,3 +167,11 @@ func TestVersionComparison(t *testing.T) {
})
}
}

// TestCheckVersionString checks if the current version string is valid and parsable.
func TestCheckVersionString(t *testing.T) {
curVer := version.NodeVersion
parsedVer, err := version.ParseVersion(curVer.StringWithAlias())
require.NoError(t, err)
assert.Equal(t, curVer, parsedVer)
}

0 comments on commit e1f8e41

Please sign in to comment.