Skip to content

Commit

Permalink
fixed problem with main_test.go, issue with rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
joereuss12 committed Oct 16, 2023
1 parent 8b3a0a8 commit 5bea9d4
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions cmd/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import (
"io"
"os"
"os/exec"
<<<<<<< HEAD
"runtime"
=======
>>>>>>> 7561678 (windows and case-friendly executable alias)
"strings"

"testing"
Expand Down Expand Up @@ -108,14 +105,10 @@ func TestHandleCLIVersionFlag(t *testing.T) {
func TestHandleCLIExecutableAlias(t *testing.T) {
// If we're in the process started by exec.Command, run the handleCLI function.
if os.Getenv("BE_CRASHER") == "1" {
<<<<<<< HEAD
err := handleCLI(os.Args[1:])
if err != nil {
t.Fatalf("Function returns error")
}
=======
handleCLI(os.Args[1:])
>>>>>>> 7561678 (windows and case-friendly executable alias)
return
}

Expand Down Expand Up @@ -193,11 +186,6 @@ func TestHandleCLIExecutableAlias(t *testing.T) {
if !ok {
t.Fatal("Failed to cast error as *exec.ExitError")
}
<<<<<<< HEAD
=======
// Here you might want to check the exit code if it's relevant to your test.
// exitCode := exitError.ExitCode()
>>>>>>> 7561678 (windows and case-friendly executable alias)
}
// Apparently both stashcp and *_plug will trigger Exit(1) with error if
// the arguments are not enough/solid
Expand All @@ -209,7 +197,6 @@ func TestHandleCLIExecutableAlias(t *testing.T) {
}
}
for _, tc := range testCases {
<<<<<<< HEAD
if os := runtime.GOOS; os == "windows" {
// On Windows, you can only do *.exe
t.Run(tc.name+"-windows", func(t *testing.T) {
Expand All @@ -235,22 +222,5 @@ func TestHandleCLIExecutableAlias(t *testing.T) {
tc.args[0] = preserve
})
}
=======
t.Run(tc.name, func(t *testing.T) {
batchTest(t, tc.args, tc.expected)
})
t.Run(tc.name+"-windows", func(t *testing.T) {
preserve := tc.args[0]
tc.args[0] = preserve + ".exe"
batchTest(t, tc.args, tc.expected)
tc.args[0] = preserve
})
t.Run(tc.name+"-mixedCase", func(t *testing.T) {
preserve := tc.args[0]
tc.args[0] = strings.ToUpper(preserve)
batchTest(t, tc.args, tc.expected)
tc.args[0] = preserve
})
>>>>>>> 7561678 (windows and case-friendly executable alias)
}
}
}

0 comments on commit 5bea9d4

Please sign in to comment.