MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestI128ToNumString

Function TestI128ToNumString

common/int128_test.go:128–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestI128ToNumString(t *testing.T) {
129 numbers := []int64{1, 255, 256, 123456, -1, -127, -128, -255, -256}
130 strings := []string{"1", "255", "256", "123456", "-1", "-127", "-128", "-255", "-256"}
131 for i, num := range numbers {
132 u1 := I128FromInt64(num)
133 u2, err := I128FromBigInt(big.NewInt(num))
134
135 assert.Nil(t, err)
136 assert.Equal(t, u1, u2)
137 assert.Equal(t, u2.ToNumString(), strings[i])
138 }
139}

Callers

nothing calls this directly

Calls 3

I128FromInt64Function · 0.85
I128FromBigIntFunction · 0.85
ToNumStringMethod · 0.80

Tested by

no test coverage detected