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

Function TestBigIntBitSet

bigint_test.go:1939–1961  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1937}
1938
1939func TestBigIntBitSet(t *testing.T) {
1940 for _, test := range bitwiseTests {
1941 x := new(BigInt)
1942 x.SetString(test.x, 0)
1943 testBitset(t, x)
1944 x = new(BigInt)
1945 x.SetString(test.y, 0)
1946 testBitset(t, x)
1947 }
1948 for i, test := range bitsetTests {
1949 x := new(BigInt)
1950 x.SetString(test.x, 0)
1951 b := x.Bit(test.i)
1952 if b != test.b {
1953 t.Errorf("#%d got %v want %v", i, b, test.b)
1954 }
1955 }
1956 z := NewBigInt(1)
1957 z.SetBit(NewBigInt(0), 2, 1)
1958 if z.Cmp(NewBigInt(4)) != 0 {
1959 t.Errorf("destination leaked into result; got %s want 4", z)
1960 }
1961}
1962
1963var tzbTests = []struct {
1964 in string

Callers

nothing calls this directly

Calls 6

SetBitMethod · 0.95
CmpMethod · 0.95
testBitsetFunction · 0.85
NewBigIntFunction · 0.85
BitMethod · 0.80
SetStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…