Add rangeOfInteger attribute.
This commit was merged in pull request #10.
This commit is contained in:
24
packages/ipp/rangeofinteger_test.go
Normal file
24
packages/ipp/rangeofinteger_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package ipp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestUnMarshalSingleRange(T *testing.T) {
|
||||
testdata := []byte{
|
||||
0x00, 0x04,
|
||||
0x66, 0x6c, 0x6f, 0x70, //flop
|
||||
0x00, 0x08,
|
||||
0x00, 0x0, 0x0, 0x4, 0x00, 0x0, 0x0, 0x5,
|
||||
}
|
||||
|
||||
buf := bytes.NewBuffer(testdata)
|
||||
|
||||
n, v := unmarshalSingleRangeOfInteger(buf)
|
||||
assert.Equal(T, "flop", n, "Should be equal")
|
||||
assert.Equal(T, int32(4), v.lower, "Should be equal")
|
||||
assert.Equal(T, int32(5), v.upper, "Should be equal")
|
||||
}
|
||||
Reference in New Issue
Block a user