MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / TestGitVersionParse

Function TestGitVersionParse

mob_test.go:1951–1966  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1949}
1950
1951func TestGitVersionParse(t *testing.T) {
1952 // Check real examples
1953 equals(t, GitVersion{2, 34, 1}, parseGitVersion("git version 2.34.1"))
1954 equals(t, GitVersion{2, 38, 1}, parseGitVersion("git version 2.38.1.windows.1"))
1955 // Check missing prefix
1956 equals(t, GitVersion{1, 2, 3}, parseGitVersion("git 1.2.3"))
1957 equals(t, GitVersion{4, 5, 6}, parseGitVersion("4.5.6"))
1958 // Check missing minor and patch
1959 equals(t, GitVersion{2, 5, 0}, parseGitVersion("git version 2.5"))
1960 equals(t, GitVersion{2, 0, 0}, parseGitVersion("git version 2"))
1961 equals(t, GitVersion{4, 0, 0}, parseGitVersion("4"))
1962 // Invalid versions
1963 equals(t, GitVersion{0, 0, 0}, parseGitVersion("not version"))
1964 equals(t, GitVersion{2, 0, 0}, parseGitVersion("2.xyz3.5"))
1965 equals(t, GitVersion{2, 0, 0}, parseGitVersion("2.9999999999999999999999.5"))
1966}
1967
1968func TestGitVersionCompare(t *testing.T) {
1969 // Check real examples

Callers

nothing calls this directly

Calls 2

equalsFunction · 0.85
parseGitVersionFunction · 0.85

Tested by

no test coverage detected