MCPcopy
hub / github.com/TarsCloud/TarsGo / TestInt64

Function TestInt64

tars/protocol/codec/codec_test.go:168–182  ·  view source on GitHub ↗

TestInt64 tests the read and write of the int64 type.

(t *testing.T)

Source from the content-addressed store, hash-verified

166
167// TestInt64 tests the read and write of the int64 type.
168func TestInt64(t *testing.T) {
169 b := NewBuffer()
170 err := b.WriteInt64(math.MinInt64, byte(10))
171 if err != nil {
172 t.Error(err)
173 }
174 var data int64
175 err = r(b).ReadInt64(&data, byte(10), true)
176 if err != nil {
177 t.Error(err)
178 }
179 if data != math.MinInt64 {
180 t.Error("no eq.")
181 }
182}
183
184// TestSkipString tests skip the string.
185func TestSkipString(t *testing.T) {

Callers

nothing calls this directly

Calls 5

WriteInt64Method · 0.95
NewBufferFunction · 0.85
rFunction · 0.85
ReadInt64Method · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected