blob: 0470e44460818090de0230983ceceeffda17e861 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package proto
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestReader_Int32(t *testing.T) {
var b Buffer
b.PutInt32(1056)
v, err := b.Reader().Int32()
require.NoError(t, err)
require.Equal(t, int32(1056), v)
}
func TestReader_Int64(t *testing.T) {
var b Buffer
b.PutInt64(204789)
v, err := b.Reader().Int64()
require.NoError(t, err)
require.Equal(t, int64(204789), v)
}
func TestReader_Int(t *testing.T) {
var b Buffer
b.PutInt(529)
v, err := b.Reader().Int()
require.NoError(t, err)
require.Equal(t, 529, v)
}
|