Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit 30e8b02

Browse files
authored
improve coverage / faster tests
2 parents 36bd76d + 985f060 commit 30e8b02

File tree

5 files changed

+303
-116
lines changed

5 files changed

+303
-116
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ ci/lastbuilt.txt
2222
*-darwinamd64
2323
*-linux386
2424
*-linuxamd64
25-
ideas.md
25+
ideas.md
26+
coverage.txt

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ language: go
55
go:
66
- 1.13.x
77
script:
8-
- go test --tags="travis" -race -coverprofile=coverage.txt -covermode=atomic ./...
8+
- go test --tags="travis" -coverprofile=coverage.txt -covermode=atomic ./...
99
- go build -v ./...
1010
after_success:
1111
- bash <(curl -s https://codecov.io/bash)

database/common.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ func ValidatePwhashReg(name string, pwhash string) (User, error) {
138138
func ValidateAccessToken(name string, accessToken string) (User, error) {
139139
var dummy User
140140

141-
if len(accessToken) > consts.AccessTokenLength {
142-
return dummy, errors.New("access token lengths don't match")
141+
if len(accessToken) > consts.AccessTokenLength || len(accessToken) < consts.AccessTokenLength {
142+
return dummy, errors.New("incorrect token length")
143143
}
144144

145145
users, err := RetrieveAllUsers()

0 commit comments

Comments
 (0)