Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
godrei committed Sep 30, 2015
1 parent 30f4960 commit b30c3b6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,38 @@ import (
//
// --- TESTS

func TestFindMajorVersion(t *testing.T) {
func TestFindXcodeMajorVersion(t *testing.T) {
// Should find
versionStr := `
Xcode 7.0
Build version 7A220`

version, err := findMajorVersion(versionStr)
version, err := findXcodeMajorVersion(versionStr)
if err != nil {
t.Fatalf("Failed to findMajorVersion: %s", err)
}
if version != 7 {
t.Fatalf("Expected version (7), actual (%d)", version)
}

// Should find
versionStr = `
Xcode 6.1
Build version 7A220`

version, err = findXcodeMajorVersion(versionStr)
if err != nil {
t.Fatalf("Failed to findMajorVersion: %s", err)
}
if version != 6 {
t.Fatalf("Expected version (6), actual (%d)", version)
}

// Should not find
versionStr = `
Build version 7A220`

version, err = findMajorVersion(versionStr)
version, err = findXcodeMajorVersion(versionStr)
if err == nil {
t.Fatalf("Should failed to findMajorVersion: %s", err)
}
Expand Down

0 comments on commit b30c3b6

Please sign in to comment.