(t *testing.T)
| 293 | } |
| 294 | |
| 295 | func TestNewFromStringErrs(t *testing.T) { |
| 296 | tests := []string{ |
| 297 | "", |
| 298 | "qwert", |
| 299 | "-", |
| 300 | ".", |
| 301 | "-.", |
| 302 | ".-", |
| 303 | "234-.56", |
| 304 | "234-56", |
| 305 | "2-", |
| 306 | "..", |
| 307 | "2..", |
| 308 | "..2", |
| 309 | ".5.2", |
| 310 | "8..2", |
| 311 | "8.1.", |
| 312 | "1e", |
| 313 | "1-e", |
| 314 | "1e9e", |
| 315 | "1ee9", |
| 316 | "1ee", |
| 317 | "1eE", |
| 318 | "1e-", |
| 319 | "1e-.", |
| 320 | "1e1.2", |
| 321 | "123.456e1.3", |
| 322 | "1e-1.2", |
| 323 | "123.456e-1.3", |
| 324 | "123.456Easdf", |
| 325 | "123.456e" + strconv.FormatInt(math.MinInt64, 10), |
| 326 | "123.456e" + strconv.FormatInt(math.MinInt32, 10), |
| 327 | "512.99 USD", |
| 328 | "$99.99", |
| 329 | "51,850.00", |
| 330 | "20_000_000.00", |
| 331 | "$20_000_000.00", |
| 332 | } |
| 333 | |
| 334 | for _, s := range tests { |
| 335 | _, err := NewFromString(s) |
| 336 | |
| 337 | if err == nil { |
| 338 | t.Errorf("error expected when parsing %s", s) |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | func TestNewFromStringDeepEquals(t *testing.T) { |
| 344 | type StrCmp struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…