MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestExp

Function TestExp

utils/big_test.go:303–317  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

301}
302
303func TestExp(t *testing.T) {
304 tests := []struct{ base, exponent, result *big.Int }{
305 {base: big.NewInt(0), exponent: big.NewInt(0), result: big.NewInt(1)},
306 {base: big.NewInt(1), exponent: big.NewInt(0), result: big.NewInt(1)},
307 {base: big.NewInt(1), exponent: big.NewInt(1), result: big.NewInt(1)},
308 {base: big.NewInt(1), exponent: big.NewInt(2), result: big.NewInt(1)},
309 {base: big.NewInt(3), exponent: big.NewInt(144), result: MustParseBig256("507528786056415600719754159741696356908742250191663887263627442114881")},
310 {base: big.NewInt(2), exponent: big.NewInt(255), result: MustParseBig256("57896044618658097711785492504343953926634992332820282019728792003956564819968")},
311 }
312 for _, test := range tests {
313 if result := Exp(test.base, test.exponent); result.Cmp(test.result) != 0 {
314 t.Errorf("exp(%d, %d) = %d, want %d", test.base, test.exponent, result, test.result)
315 }
316 }
317}

Callers

nothing calls this directly

Calls 3

MustParseBig256Function · 0.85
ExpFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected