File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 go-version : stable
1717 - name : Calculate coverage
1818 run : |
19- go test -v -covermode=count -coverprofile=cover.out.raw -coverpkg=./... ./...
19+ go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./...
2020 # remove mocks from coverage calculation
2121 grep -v mock_ cover.out.raw > cover.out
2222 - name : Generage coverage badge
Original file line number Diff line number Diff line change 11/dist
2+ /cover.out
Original file line number Diff line number Diff line change 2020.PHONY : fuzz
2121fuzz : mod-tidy generate
2222 go test -fuzz=' ^Fuzz' -fuzztime=10s -v ./internal/server
23+
24+ .PHONY : cover
25+ cover : mod-tidy generate
26+ go test -v -covermode=atomic -coverprofile=cover.out -coverpkg=./... ./...
27+ go tool cover -html=cover.out
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ Then push some code to main:
5858 git checkout --orphan badges
5959 git rm -rf .
6060 rm -f .gitignore
61- echo ' This branch exists only to contains the coverage badge in the README on `main`.' > README.md
61+ echo ' This branch exists only to store the coverage badge in the README on `main`.' > README.md
6262 git add README.md
6363 git commit -m ' chore: initialize the badges branch'
6464 git push origin badges
@@ -101,7 +101,7 @@ Configure the repository:
101101
1021021. Go to repository Settings > Rules > Rulesets, and import the ` protect-default-branch.json` ruleset.
103103
104- 1. That' s it.
104+ That' s it.
105105
106106## How to contribute
107107
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ func TestGreet(t *testing.T) {
4747 expect : "time travel detected" ,
4848 expectError : true ,
4949 },
50+ "late birthday" : {
51+ input : []string {"Foo" , "2000-12-22" },
52+ expect : "Hello Foo, happy belated birthday for 355 days ago." ,
53+ },
5054 }
5155 for name , tc := range testCases {
5256 t .Run (name , func (tt * testing.T ) {
You can’t perform that action at this time.
0 commit comments