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

Function TestTableExp10

table_test.go:143–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

141}
142
143func TestTableExp10(t *testing.T) {
144 tests := []struct {
145 pow int64
146 str string
147 }{
148 {
149 pow: 0,
150 str: "1",
151 },
152 {
153 pow: 1,
154 str: "10",
155 },
156 {
157 pow: 5,
158 str: "100000",
159 },
160 {
161 pow: powerTenTableSize + 1,
162 str: "1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
163 },
164 }
165
166 for i, test := range tests {
167 var tmpE BigInt
168 d := tableExp10(test.pow, &tmpE)
169 if s := d.String(); s != test.str {
170 t.Errorf("%d: expected PowerOfTenDec(%d) to give %s, got %s", i, test.pow, test.str, s)
171 }
172 }
173}
174
175// TestNumDigitsLargeNegative is a regression test for a bug where NumDigits
176// would panic with a nil pointer dereference when processing large negative

Callers

nothing calls this directly

Calls 2

tableExp10Function · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…