From 5312f4037627aa37b546cc68c05603bc70513f83 Mon Sep 17 00:00:00 2001 From: bughou Date: Mon, 8 Nov 2021 17:44:16 +0800 Subject: [PATCH] fix test --- .github/workflows/go.yml | 7 ++++++- path_test.go | 6 ++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0aa73ce..d3ace5b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -38,11 +38,16 @@ jobs: run: go build -v ./... - name: Test + run: go test -v ./... + if: ${{ ! (matrix.os == 'ubuntu-latest' && matrix.go == '1.16') }} + + - name: Test with coverage run: go test -v -coverprofile=profile.cov ./... + if: ${{ matrix.os == 'ubuntu-latest' && matrix.go == '1.16' }} - name: Send coverage uses: shogo82148/actions-goveralls@v1 with: path-to-profile: profile.cov - if: ${{ matrix.go == '1.16' }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.go == '1.16' }} diff --git a/path_test.go b/path_test.go index de32516..1ce9fc6 100644 --- a/path_test.go +++ b/path_test.go @@ -8,15 +8,13 @@ import ( func ExampleSourceDir() { p := SourceDir() - fmt.Println(p) - fmt.Println(strings.HasSuffix(filepath.ToSlash(p), `github.com/lovego/fs`)) + fmt.Println(strings.HasSuffix(filepath.ToSlash(p), `/fs`)) // Output: true } func ExampleSourceFile() { p := SourceFile() - fmt.Println(p) - fmt.Println(strings.HasSuffix(filepath.ToSlash(p), `github.com/lovego/fs/path_test.go`)) + fmt.Println(strings.HasSuffix(filepath.ToSlash(p), `/fs/path_test.go`)) // Output: true }