(t *testing.T)
| 271 | } |
| 272 | |
| 273 | func TestFloat64(t *testing.T) { |
| 274 | for _, x := range testTable { |
| 275 | if x.inexact == "" || x.inexact == "-" { |
| 276 | continue |
| 277 | } |
| 278 | s := x.exact |
| 279 | d, err := NewFromString(s) |
| 280 | if err != nil { |
| 281 | t.Errorf("error while parsing %s", s) |
| 282 | } else if f, exact := d.Float64(); !exact || f != x.float { |
| 283 | t.Errorf("cannot represent exactly %s", s) |
| 284 | } |
| 285 | s = x.inexact |
| 286 | d, err = NewFromString(s) |
| 287 | if err != nil { |
| 288 | t.Errorf("error while parsing %s", s) |
| 289 | } else if f, exact := d.Float64(); exact || f != x.float { |
| 290 | t.Errorf("%s should be represented inexactly", s) |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | func TestNewFromStringErrs(t *testing.T) { |
| 296 | tests := []string{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…