Fix go tests for commit structure changes

This commit is contained in:
Steve Streeting 2015-08-25 17:14:48 +01:00
parent aba8f6dd10
commit 049bb52093
2 changed files with 24 additions and 24 deletions

@ -23,25 +23,25 @@ func TestCurrentRefAndCurrentRemoteRef(t *testing.T) {
inputs := []*test.CommitInput{ inputs := []*test.CommitInput{
{ // 0 { // 0
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 20, nil}, {Filename: "file1.txt", Size: 20},
}, },
}, },
{ // 1 { // 1
NewBranch: "branch2", NewBranch: "branch2",
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 25, nil}, {Filename: "file1.txt", Size: 25},
}, },
}, },
{ // 2 { // 2
ParentBranches: []string{"master"}, // back on master ParentBranches: []string{"master"}, // back on master
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 30, nil}, {Filename: "file1.txt", Size: 30},
}, },
}, },
{ // 3 { // 3
NewBranch: "branch3", NewBranch: "branch3",
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 32, nil}, {Filename: "file1.txt", Size: 32},
}, },
}, },
} }
@ -78,7 +78,7 @@ func TestRecentBranches(t *testing.T) {
{ // 0 { // 0
CommitDate: now.AddDate(0, 0, -20), CommitDate: now.AddDate(0, 0, -20),
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 20, nil}, {Filename: "file1.txt", Size: 20},
}, },
}, },
{ // 1 { // 1
@ -86,35 +86,35 @@ func TestRecentBranches(t *testing.T) {
NewBranch: "excluded_branch", // new branch & tag but too old NewBranch: "excluded_branch", // new branch & tag but too old
Tags: []string{"excluded_tag"}, Tags: []string{"excluded_tag"},
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 25, nil}, {Filename: "file1.txt", Size: 25},
}, },
}, },
{ // 2 { // 2
CommitDate: now.AddDate(0, 0, -12), CommitDate: now.AddDate(0, 0, -12),
ParentBranches: []string{"master"}, // back on master ParentBranches: []string{"master"}, // back on master
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 30, nil}, {Filename: "file1.txt", Size: 30},
}, },
}, },
{ // 3 { // 3
CommitDate: now.AddDate(0, 0, -6), CommitDate: now.AddDate(0, 0, -6),
NewBranch: "included_branch", // new branch within 7 day limit NewBranch: "included_branch", // new branch within 7 day limit
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 32, nil}, {Filename: "file1.txt", Size: 32},
}, },
}, },
{ // 4 { // 4
CommitDate: now.AddDate(0, 0, -3), CommitDate: now.AddDate(0, 0, -3),
NewBranch: "included_branch_2", // new branch within 7 day limit NewBranch: "included_branch_2", // new branch within 7 day limit
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 36, nil}, {Filename: "file1.txt", Size: 36},
}, },
}, },
{ // 5 { // 5
// Final commit, current date/time // Final commit, current date/time
ParentBranches: []string{"master"}, // back on master ParentBranches: []string{"master"}, // back on master
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 21, nil}, {Filename: "file1.txt", Size: 21},
}, },
}, },
} }

@ -25,25 +25,25 @@ func TestScanUnpushed(t *testing.T) {
inputs := []*test.CommitInput{ inputs := []*test.CommitInput{
{ // 0 { // 0
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 20, nil}, {Filename: "file1.txt", Size: 20},
}, },
}, },
{ // 1 { // 1
NewBranch: "branch2", NewBranch: "branch2",
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 25, nil}, {Filename: "file1.txt", Size: 25},
}, },
}, },
{ // 2 { // 2
ParentBranches: []string{"master"}, // back on master ParentBranches: []string{"master"}, // back on master
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 30, nil}, {Filename: "file1.txt", Size: 30},
}, },
}, },
{ // 3 { // 3
NewBranch: "branch3", NewBranch: "branch3",
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 32, nil}, {Filename: "file1.txt", Size: 32},
}, },
}, },
} }
@ -91,37 +91,37 @@ func TestScanPreviousVersions(t *testing.T) {
{ // 0 { // 0
CommitDate: now.AddDate(0, 0, -20), CommitDate: now.AddDate(0, 0, -20),
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file1.txt", 20, nil}, {Filename: "file1.txt", Size: 20},
{"file2.txt", 30, nil}, {Filename: "file2.txt", Size: 30},
{"folder/nested.txt", 40, nil}, {Filename: "folder/nested.txt", Size: 40},
{"folder/nested2.txt", 31, nil}, {Filename: "folder/nested2.txt", Size: 31},
}, },
}, },
{ // 1 { // 1
CommitDate: now.AddDate(0, 0, -10), CommitDate: now.AddDate(0, 0, -10),
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file2.txt", 22, nil}, {Filename: "file2.txt", Size: 22},
}, },
}, },
{ // 2 { // 2
NewBranch: "excluded", NewBranch: "excluded",
CommitDate: now.AddDate(0, 0, -6), CommitDate: now.AddDate(0, 0, -6),
Files: []*test.FileInput{ Files: []*test.FileInput{
{"file2.txt", 12, nil}, {Filename: "file2.txt", Size: 12},
{"folder/nested2.txt", 16, nil}, {Filename: "folder/nested2.txt", Size: 16},
}, },
}, },
{ // 3 { // 3
ParentBranches: []string{"master"}, ParentBranches: []string{"master"},
CommitDate: now.AddDate(0, 0, -4), CommitDate: now.AddDate(0, 0, -4),
Files: []*test.FileInput{ Files: []*test.FileInput{
{"folder/nested.txt", 42, nil}, {Filename: "folder/nested.txt", Size: 42},
{"folder/nested2.txt", 6, nil}, {Filename: "folder/nested2.txt", Size: 6},
}, },
}, },
{ // 4 { // 4
Files: []*test.FileInput{ Files: []*test.FileInput{
{"folder/nested.txt", 22, nil}, {Filename: "folder/nested.txt", Size: 22},
}, },
}, },
} }