test: added one more test

This commit is contained in:
Reinaldy Rafli 2021-07-15 01:24:47 +07:00
parent 4858eaf42e
commit ec16f91f7b
2 changed files with 12 additions and 2 deletions

View File

@ -38,10 +38,10 @@ jobs:
run: go mod vendor run: go mod vendor
- name: Build - name: Build
run: go build ./ run: go build main.go
- name: Run test & coverage - name: Run test & coverage
run: go test -v -race -coverprofile=coverage.out -covermode=atomic -failfast ./... run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v1

View File

@ -27,4 +27,14 @@ func TestIsToday(t *testing.T) {
t.Error("today should be false:", today) t.Error("today should be false:", today)
} }
}) })
t.Run("should return false with no error if no date is supplied", func(t *testing.T) {
today, err := utils.IsToday("")
if err != nil {
t.Error(err.Error())
}
if today != false {
t.Error("it should be false:", today)
}
})
} }