Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed Oct 5, 2024
1 parent 9e8b8b8 commit af436f4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -24,6 +24,27 @@ jobs:

- name: Use Exiftool
uses: woss/[email protected]
if: matrix.os != 'windows-latest'

- name: Install winget
uses: Cyberboss/install-winget@v1
if: matrix.os == 'windows-latest'

- name: Install Exiftool
run: winget install exiftool --disable-interactivity --accept-source-agreements
if: matrix.os == 'windows-latest'

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest

- name: Run tests
run: go test ./... -race
run: go test ./... -json -v -race 2>&1 | tee /tmp/gotest.log | gotestfmt

# Upload the original go test log as an artifact for later review.
- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log-${{ matrix.os }}
path: /tmp/gotest.log
if-no-files-found: error
11 changes: 9 additions & 2 deletions app/app_test/app_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,15 @@ func TestPipingInputFromFind(t *testing.T) {
},
},
{
name: "find a.txt and b.txt files",
findArgs: []string{"testdata", "-regex", `.*\/\(a\|b\)\.txt$`},
name: "find a.txt and b.txt files",
findArgs: []string{
"testdata",
"-name",
"a.txt",
"-o",
"-name",
"b.txt",
},
expected: []string{
"testdata/a.txt",
"testdata/b.txt",
Expand Down
2 changes: 1 addition & 1 deletion replace/replace_test/variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func TestVariables(t *testing.T) {
"-f",
".*",
"-r",
"{btime.YYYY}-{ctime.MM}-{now.DD}{ext}",
"{now.YYYY}-{ctime.MM}-{btime.DD}{ext}",
},
},
{
Expand Down
3 changes: 3 additions & 0 deletions validate/validate_test/validate_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !windows
// +build !windows

package validate_test

import (
Expand Down

0 comments on commit af436f4

Please sign in to comment.