MCPcopy
hub / github.com/shopspring/decimal / TestRequireFromString

Function TestRequireFromString

decimal_test.go:372–387  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

370}
371
372func TestRequireFromString(t *testing.T) {
373 s := "1.23"
374 defer func() {
375 err := recover()
376 if err != nil {
377 t.Errorf("error while parsing %s", s)
378 }
379 }()
380
381 d := RequireFromString(s)
382 if d.String() != s {
383 t.Errorf("expected %s, got %s (%s, %d)",
384 s, d.String(),
385 d.value.String(), d.exp)
386 }
387}
388
389func TestRequireFromStringErrs(t *testing.T) {
390 s := "qwert"

Callers

nothing calls this directly

Calls 2

RequireFromStringFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…