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

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