Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bughou committed Nov 8, 2021
1 parent 6dd5804 commit 5312f40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}

6 changes: 2 additions & 4 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 5312f40

Please sign in to comment.