Skip to content

Commit

Permalink
remove hook test on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
orgrim committed Nov 11, 2023
1 parent d29bd1c commit 58f27db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

//go:build !windows

package main

import (
Expand All @@ -31,6 +33,7 @@ import (
"os"
"os/exec"
"regexp"
"runtime"

Check failure on line 36 in hook_test.go

View workflow job for this annotation

GitHub Actions / unit (ubuntu)

"runtime" imported and not used

Check failure on line 36 in hook_test.go

View workflow job for this annotation

GitHub Actions / unit (macos)

"runtime" imported and not used
"strings"
"testing"
)
Expand All @@ -42,7 +45,7 @@ func TestHookCommand(t *testing.T) {
}{
{"echo 'a'", `^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} INFO: test: a\n$`},
{"echo a'", `^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} ERROR: unable to parse hook command: No closing quotation\n$`},
{"echo 'a\nb'", `^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} INFO: test: a\n\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} INFO: test: b\n$`},
{"echo 'a\r\nb'", `^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} INFO: test: a\n\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} INFO: test: b\n$`},
{"", `^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} ERROR: unable to run an empty command\n$`},
{"/nothingBLA a", `^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} ERROR: .*/nothingBLA.*\n$`},
{"sh -c 'echo test; exit 1'", `^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} ERROR: test: test\n\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} ERROR: exit status 1\n$`},
Expand Down

0 comments on commit 58f27db

Please sign in to comment.