mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
update specs
This commit is contained in:
@ -275,7 +275,7 @@ func TestGitCommandGetStashEntries(t *testing.T) {
|
|||||||
type scenario struct {
|
type scenario struct {
|
||||||
testName string
|
testName string
|
||||||
command func(string, ...string) *exec.Cmd
|
command func(string, ...string) *exec.Cmd
|
||||||
test func([]StashEntry)
|
test func([]*StashEntry)
|
||||||
}
|
}
|
||||||
|
|
||||||
scenarios := []scenario{
|
scenarios := []scenario{
|
||||||
@ -284,7 +284,7 @@ func TestGitCommandGetStashEntries(t *testing.T) {
|
|||||||
func(string, ...string) *exec.Cmd {
|
func(string, ...string) *exec.Cmd {
|
||||||
return exec.Command("echo")
|
return exec.Command("echo")
|
||||||
},
|
},
|
||||||
func(entries []StashEntry) {
|
func(entries []*StashEntry) {
|
||||||
assert.Len(t, entries, 0)
|
assert.Len(t, entries, 0)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -293,8 +293,8 @@ func TestGitCommandGetStashEntries(t *testing.T) {
|
|||||||
func(string, ...string) *exec.Cmd {
|
func(string, ...string) *exec.Cmd {
|
||||||
return exec.Command("echo", "WIP on add-pkg-commands-test: 55c6af2 increase parallel build\nWIP on master: bb86a3f update github template")
|
return exec.Command("echo", "WIP on add-pkg-commands-test: 55c6af2 increase parallel build\nWIP on master: bb86a3f update github template")
|
||||||
},
|
},
|
||||||
func(entries []StashEntry) {
|
func(entries []*StashEntry) {
|
||||||
expected := []StashEntry{
|
expected := []*StashEntry{
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
"WIP on add-pkg-commands-test: 55c6af2 increase parallel build",
|
"WIP on add-pkg-commands-test: 55c6af2 increase parallel build",
|
||||||
@ -341,7 +341,7 @@ func TestGitCommandGetStatusFiles(t *testing.T) {
|
|||||||
type scenario struct {
|
type scenario struct {
|
||||||
testName string
|
testName string
|
||||||
command func(string, ...string) *exec.Cmd
|
command func(string, ...string) *exec.Cmd
|
||||||
test func([]File)
|
test func([]*File)
|
||||||
}
|
}
|
||||||
|
|
||||||
scenarios := []scenario{
|
scenarios := []scenario{
|
||||||
@ -350,7 +350,7 @@ func TestGitCommandGetStatusFiles(t *testing.T) {
|
|||||||
func(cmd string, args ...string) *exec.Cmd {
|
func(cmd string, args ...string) *exec.Cmd {
|
||||||
return exec.Command("echo")
|
return exec.Command("echo")
|
||||||
},
|
},
|
||||||
func(files []File) {
|
func(files []*File) {
|
||||||
assert.Len(t, files, 0)
|
assert.Len(t, files, 0)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -362,10 +362,10 @@ func TestGitCommandGetStatusFiles(t *testing.T) {
|
|||||||
"MM file1.txt\nA file3.txt\nAM file2.txt\n?? file4.txt",
|
"MM file1.txt\nA file3.txt\nAM file2.txt\n?? file4.txt",
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
func(files []File) {
|
func(files []*File) {
|
||||||
assert.Len(t, files, 4)
|
assert.Len(t, files, 4)
|
||||||
|
|
||||||
expected := []File{
|
expected := []*File{
|
||||||
{
|
{
|
||||||
Name: "file1.txt",
|
Name: "file1.txt",
|
||||||
HasStagedChanges: true,
|
HasStagedChanges: true,
|
||||||
@ -463,22 +463,22 @@ func TestGitCommandCommitAmend(t *testing.T) {
|
|||||||
func TestGitCommandMergeStatusFiles(t *testing.T) {
|
func TestGitCommandMergeStatusFiles(t *testing.T) {
|
||||||
type scenario struct {
|
type scenario struct {
|
||||||
testName string
|
testName string
|
||||||
oldFiles []File
|
oldFiles []*File
|
||||||
newFiles []File
|
newFiles []*File
|
||||||
test func([]File)
|
test func([]*File)
|
||||||
}
|
}
|
||||||
|
|
||||||
scenarios := []scenario{
|
scenarios := []scenario{
|
||||||
{
|
{
|
||||||
"Old file and new file are the same",
|
"Old file and new file are the same",
|
||||||
[]File{},
|
[]*File{},
|
||||||
[]File{
|
[]*File{
|
||||||
{
|
{
|
||||||
Name: "new_file.txt",
|
Name: "new_file.txt",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
func(files []File) {
|
func(files []*File) {
|
||||||
expected := []File{
|
expected := []*File{
|
||||||
{
|
{
|
||||||
Name: "new_file.txt",
|
Name: "new_file.txt",
|
||||||
},
|
},
|
||||||
@ -490,7 +490,7 @@ func TestGitCommandMergeStatusFiles(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Several files to merge, with some identical",
|
"Several files to merge, with some identical",
|
||||||
[]File{
|
[]*File{
|
||||||
{
|
{
|
||||||
Name: "new_file1.txt",
|
Name: "new_file1.txt",
|
||||||
},
|
},
|
||||||
@ -501,7 +501,7 @@ func TestGitCommandMergeStatusFiles(t *testing.T) {
|
|||||||
Name: "new_file3.txt",
|
Name: "new_file3.txt",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[]File{
|
[]*File{
|
||||||
{
|
{
|
||||||
Name: "new_file4.txt",
|
Name: "new_file4.txt",
|
||||||
},
|
},
|
||||||
@ -512,8 +512,8 @@ func TestGitCommandMergeStatusFiles(t *testing.T) {
|
|||||||
Name: "new_file1.txt",
|
Name: "new_file1.txt",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
func(files []File) {
|
func(files []*File) {
|
||||||
expected := []File{
|
expected := []*File{
|
||||||
{
|
{
|
||||||
Name: "new_file1.txt",
|
Name: "new_file1.txt",
|
||||||
},
|
},
|
||||||
@ -1223,7 +1223,7 @@ func TestGitCommandDiff(t *testing.T) {
|
|||||||
gitCommand := newDummyGitCommand()
|
gitCommand := newDummyGitCommand()
|
||||||
assert.NoError(t, test.GenerateRepo("lots_of_diffs.sh"))
|
assert.NoError(t, test.GenerateRepo("lots_of_diffs.sh"))
|
||||||
|
|
||||||
files := []File{
|
files := []*File{
|
||||||
{
|
{
|
||||||
Name: "deleted_staged",
|
Name: "deleted_staged",
|
||||||
HasStagedChanges: false,
|
HasStagedChanges: false,
|
||||||
|
@ -211,7 +211,7 @@ func TestGetDisplayStringArrays(t *testing.T) {
|
|||||||
{
|
{
|
||||||
[]Displayable{
|
[]Displayable{
|
||||||
Displayable(&myDisplayable{[]string{"a", "b"}}),
|
Displayable(&myDisplayable{[]string{"a", "b"}}),
|
||||||
Displayable(&myDisplayable{[]string{"a", "b"}}),
|
Displayable(&myDisplayable{[]string{"c", "d"}}),
|
||||||
},
|
},
|
||||||
[][]string{{"a", "b"}, {"c", "d"}},
|
[][]string{{"a", "b"}, {"c", "d"}},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user