MCPcopy Create free account
hub / github.com/cockroachdb/apd / TestConstWithPrecision

Function TestConstWithPrecision

const_test.go:19–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17import "testing"
18
19func TestConstWithPrecision(t *testing.T) {
20 c := makeConstWithPrecision("123.456789")
21 expected := []string{
22 "1E+2", // 0
23 "1E+2", // 1
24 "1.2E+2", // 2
25 "123.5", "123.5", // 3, 4
26 "123.45679", "123.45679", "123.45679", "123.45679", // 5..8
27 "123.456789", "123.456789", "123.456789", // 9+
28 }
29 for i, e := range expected {
30 if s := c.get(uint32(i)).String(); s != e {
31 t.Errorf("%d: expected %s, got %s", i, e, s)
32 }
33 }
34}

Callers

nothing calls this directly

Calls 3

makeConstWithPrecisionFunction · 0.85
getMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…