tests for some things that came up as regressions when building out examples.

This commit is contained in:
Will Charczuk 2016-07-16 22:56:12 -07:00
parent 230dd16308
commit 6d48c49c07
3 changed files with 104 additions and 3 deletions

View file

@ -14,7 +14,9 @@ type Range struct {
// IsZero returns if the range has been set or not.
func (r Range) IsZero() bool {
return r.Min == 0 && r.Max == 0 && r.Domain == 0
return (r.Min == 0 || math.IsNaN(r.Min)) &&
(r.Max == 0 || math.IsNaN(r.Max)) &&
r.Domain == 0
}
// Delta returns the difference between the min and max value.