1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Add new integration tests folder "shell_commands"

The folder custom_commands contained tests for both custom commands (the ones
you configure in config.yml) and shell commands (the ones you execute at the ":"
prompt). I always found this confusing, so separate these into two different
folders.
This commit is contained in:
Stefan Haller
2024-08-06 11:07:31 +02:00
parent af5b19a9da
commit 0cbe08b105
8 changed files with 17 additions and 16 deletions

View File

@ -5,7 +5,7 @@ import (
. "github.com/jesseduffield/lazygit/pkg/integration/components" . "github.com/jesseduffield/lazygit/pkg/integration/components"
) )
var BasicCmdFromConfig = NewIntegrationTest(NewIntegrationTestArgs{ var BasicCommand = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Using a custom command to create a new file", Description: "Using a custom command to create a new file",
ExtraCmdArgs: []string{}, ExtraCmdArgs: []string{},
Skip: false, Skip: false,

View File

@ -1,11 +1,11 @@
package custom_commands package shell_commands
import ( import (
"github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components" . "github.com/jesseduffield/lazygit/pkg/integration/components"
) )
var BasicCmdAtRuntime = NewIntegrationTest(NewIntegrationTestArgs{ var BasicShellCommand = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Using a custom command provided at runtime to create a new file", Description: "Using a custom command provided at runtime to create a new file",
ExtraCmdArgs: []string{}, ExtraCmdArgs: []string{},
Skip: false, Skip: false,

View File

@ -1,11 +1,11 @@
package custom_commands package shell_commands
import ( import (
"github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components" . "github.com/jesseduffield/lazygit/pkg/integration/components"
) )
var ComplexCmdAtRuntime = NewIntegrationTest(NewIntegrationTestArgs{ var ComplexShellCommand = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Using a custom command provided at runtime to create a new file, via a shell command. We invoke custom commands through a shell already. This test proves that we can run a shell within a shell, which requires complex escaping.", Description: "Using a custom command provided at runtime to create a new file, via a shell command. We invoke custom commands through a shell already. This test proves that we can run a shell within a shell, which requires complex escaping.",
ExtraCmdArgs: []string{}, ExtraCmdArgs: []string{},
Skip: false, Skip: false,

View File

@ -1,4 +1,4 @@
package custom_commands package shell_commands
import ( import (
"github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/config"

View File

@ -1,4 +1,4 @@
package custom_commands package shell_commands
import ( import (
"github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/config"

View File

@ -1,4 +1,4 @@
package custom_commands package shell_commands
import ( import (
"github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/config"

View File

@ -1,4 +1,4 @@
package custom_commands package shell_commands
import ( import (
"github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/config"

View File

@ -21,6 +21,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/integration/tests/misc" "github.com/jesseduffield/lazygit/pkg/integration/tests/misc"
"github.com/jesseduffield/lazygit/pkg/integration/tests/patch_building" "github.com/jesseduffield/lazygit/pkg/integration/tests/patch_building"
"github.com/jesseduffield/lazygit/pkg/integration/tests/reflog" "github.com/jesseduffield/lazygit/pkg/integration/tests/reflog"
"github.com/jesseduffield/lazygit/pkg/integration/tests/shell_commands"
"github.com/jesseduffield/lazygit/pkg/integration/tests/staging" "github.com/jesseduffield/lazygit/pkg/integration/tests/staging"
"github.com/jesseduffield/lazygit/pkg/integration/tests/stash" "github.com/jesseduffield/lazygit/pkg/integration/tests/stash"
"github.com/jesseduffield/lazygit/pkg/integration/tests/status" "github.com/jesseduffield/lazygit/pkg/integration/tests/status"
@ -115,20 +116,14 @@ var tests = []*components.IntegrationTest{
conflicts.ResolveMultipleFiles, conflicts.ResolveMultipleFiles,
conflicts.UndoChooseHunk, conflicts.UndoChooseHunk,
custom_commands.AccessCommitProperties, custom_commands.AccessCommitProperties,
custom_commands.BasicCmdAtRuntime, custom_commands.BasicCommand,
custom_commands.BasicCmdFromConfig,
custom_commands.CheckForConflicts, custom_commands.CheckForConflicts,
custom_commands.ComplexCmdAtRuntime,
custom_commands.DeleteFromHistory,
custom_commands.EditHistory,
custom_commands.FormPrompts, custom_commands.FormPrompts,
custom_commands.GlobalContext, custom_commands.GlobalContext,
custom_commands.History,
custom_commands.MenuFromCommand, custom_commands.MenuFromCommand,
custom_commands.MenuFromCommandsOutput, custom_commands.MenuFromCommandsOutput,
custom_commands.MultipleContexts, custom_commands.MultipleContexts,
custom_commands.MultiplePrompts, custom_commands.MultiplePrompts,
custom_commands.OmitFromHistory,
custom_commands.ShowOutputInPanel, custom_commands.ShowOutputInPanel,
custom_commands.SuggestionsCommand, custom_commands.SuggestionsCommand,
custom_commands.SuggestionsPreset, custom_commands.SuggestionsPreset,
@ -267,6 +262,12 @@ var tests = []*components.IntegrationTest{
reflog.DoNotShowBranchMarkersInReflogSubcommits, reflog.DoNotShowBranchMarkersInReflogSubcommits,
reflog.Patch, reflog.Patch,
reflog.Reset, reflog.Reset,
shell_commands.BasicShellCommand,
shell_commands.ComplexShellCommand,
shell_commands.DeleteFromHistory,
shell_commands.EditHistory,
shell_commands.History,
shell_commands.OmitFromHistory,
staging.DiffChangeScreenMode, staging.DiffChangeScreenMode,
staging.DiffContextChange, staging.DiffContextChange,
staging.DiscardAllChanges, staging.DiscardAllChanges,