Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Taras Kushnir authored and Taras Kushnir committed Aug 22, 2019
1 parent c44c702 commit b2d067e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,7 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
*.coverage
coverage.txt

tdg.log
22 changes: 22 additions & 0 deletions todogenerator_test.go
Expand Up @@ -154,3 +154,25 @@ func TestTitleWords(t *testing.T) {
})
}
}

var estimateTests = []struct {
in string
out float64
}{
{"", 0},
{"30", 30},
{"30h", 30},
{"30m", 0.5},
{"30x", 0},
}

func TestEstimates(t *testing.T) {
for _, tt := range estimateTests {
t.Run(tt.in, func(t *testing.T) {
e, _ := parseEstimate(tt.in)
if e != tt.out {
t.Errorf("got %v, expected %v", e, tt.out)
}
})
}
}

0 comments on commit b2d067e

Please sign in to comment.