func TestValueRange_OpenClosed(t *testing.T) {
	valueRange := OpenClosed(Int64Value(10), Int64Value(114))
	assert.False(t, valueRange.Empty(), "the ValueRange should not be empty")
	assert.True(t, OpenClosed(Int64Value(10), Int64Value(10)).Empty(), "the ValueRange should be empty")
	assert.True(t, valueRange.HasLowerBound(), "the ValueRange should have a lower bound")
	assert.True(t, valueRange.HasUpperBound(), "the ValueRange should have an upper bound")
	assert.Equal(t, valueRange.LowerBoundType(), BoundTypeOpen, "the lower bound should be Open")
	assert.Equal(t, valueRange.UpperBoundType(), BoundTypeClosed, "the lower bound should be Closed")
	assert.Equal(t, &EndPoint{value: Int64Value(10), boundType: BoundTypeOpen}, valueRange.LowerEndPoint(), "the lower EndPoint should be equal to the expected value")
	assert.Equal(t, &EndPoint{value: Int64Value(114), boundType: BoundTypeClosed}, valueRange.UpperEndPoint(), "the upper EndPoint should be equal to the expected value")
	assert.Equal(t, 1, valueRange.Compare(Int64Value(9)), "the ValueRange should be larger than Int64Value(9)")
	assert.Equal(t, 1, valueRange.Compare(Int64Value(10)), "the ValueRange should be larger than Int64Value(10)")
	assert.Equal(t, 0, valueRange.Compare(Int64Value(50)), "the ValueRange should contain Int64Value(50)")
	assert.Equal(t, 0, valueRange.Compare(Int64Value(114)), "the ValueRange should contain Int64Value(114)")
	assert.Equal(t, -1, valueRange.Compare(Int64Value(115)), "the ValueRange should be smaller than Int64Value(115)")
	assert.False(t, valueRange.Contains(Int64Value(9)), "the ValueRange should not contain Int64Value(9)")
	assert.False(t, valueRange.Contains(Int64Value(10)), "the ValueRange should not contain Int64Value(10)")
	assert.True(t, valueRange.Contains(Int64Value(50)), "the ValueRange should contain Int64Value(50)")
	assert.True(t, valueRange.Contains(Int64Value(114)), "the ValueRange should contain Int64Value(114)")
	assert.False(t, valueRange.Contains(Int64Value(115)), "the ValueRange should not contain Int64Value(115)")
	valueRangeBytes := valueRange.Bytes()
	restoredValueRange, consumedBytes, err := FromBytes(valueRangeBytes)
	require.NoError(t, err)
	assert.Equal(t, len(valueRangeBytes), consumedBytes, "parsing the ValueRange should consume all available bytes")
	assert.Equal(t, valueRange, restoredValueRange, "the restored ValueRange should be equal to the original one")
}
TestValueRange_OpenClosed tests the OpenClosed ValueRange which contains the elements: {x | lower < x <= upper}.
package valuerange
import (
	"testing"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)
func TestValueRange_Open(t *testing.T) {
	valueRange := Open(Int64Value(10), Int64Value(114))
	assert.False(t, valueRange.Empty(), "the ValueRange should not be empty")
	assert.False(t, Open(Int64Value(10), Int64Value(11)).Empty(), "the ValueRange should not be empty")
	assert.True(t, valueRange.HasLowerBound(), "the ValueRange should have a lower bound")
	assert.True(t, valueRange.HasUpperBound(), "the ValueRange should have an upper bound")
	assert.Equal(t, valueRange.LowerBoundType(), BoundTypeOpen, "the lower bound should be Open")
	assert.Equal(t, valueRange.UpperBoundType(), BoundTypeOpen, "the lower bound should be Open")
	assert.Equal(t, &EndPoint{value: Int64Value(10), boundType: BoundTypeOpen}, valueRange.LowerEndPoint(), "the lower EndPoint should be equal to the expected value")
	assert.Equal(t, &EndPoint{value: Int64Value(114), boundType: BoundTypeOpen}, valueRange.UpperEndPoint(), "the upper EndPoint should be equal to the expected value")
	assert.Equal(t, 1, valueRange.Compare(Int64Value(9)), "the ValueRange should be larger than Int64Value(9)")
	assert.Equal(t, 1, valueRange.Compare(Int64Value(10)), "the ValueRange should be larger than Int64Value(10)")
	assert.Equal(t, 0, valueRange.Compare(Int64Value(50)), "the ValueRange should contain Int64Value(50)")
	assert.Equal(t, -1, valueRange.Compare(Int64Value(114)), "the ValueRange should be smaller than Int64Value(114)")
	assert.Equal(t, -1, valueRange.Compare(Int64Value(115)), "the ValueRange should be smaller than Int64Value(115)")
	assert.False(t, valueRange.Contains(Int64Value(9)), "the ValueRange should not contain Int64Value(9)")
	assert.False(t, valueRange.Contains(Int64Value(10)), "the ValueRange should not contain Int64Value(10)")
	assert.True(t, valueRange.Contains(Int64Value(50)), "the ValueRange should contain Int64Value(50)")
	assert.False(t, valueRange.Contains(Int64Value(114)), "the ValueRange should not contain Int64Value(114)")
	assert.False(t, valueRange.Contains(Int64Value(115)), "the ValueRange should not contain Int64Value(115)")
	valueRangeBytes := valueRange.Bytes()
	restoredValueRange, consumedBytes, err := FromBytes(valueRangeBytes)
	require.NoError(t, err)
	assert.Equal(t, len(valueRangeBytes), consumedBytes, "parsing the ValueRange should consume all available bytes")
	assert.Equal(t, valueRange, restoredValueRange, "the restored ValueRange should be equal to the original one")
}
func TestValueRange_Closed(t *testing.T) {
	valueRange := Closed(Int64Value(10), Int64Value(114))
	assert.False(t, valueRange.Empty(), "the ValueRange should not be empty")
	assert.True(t, Closed(Int64Value(10), Int64Value(10)).Empty(), "the ValueRange should be empty")
	assert.True(t, valueRange.HasLowerBound(), "the ValueRange should have a lower bound")
	assert.True(t, valueRange.HasUpperBound(), "the ValueRange should have an upper bound")
	assert.Equal(t, valueRange.LowerBoundType(), BoundTypeClosed, "the lower bound should be Closed")
	assert.Equal(t, valueRange.UpperBoundType(), BoundTypeClosed, "the lower bound should be Closed")
	assert.Equal(t, &EndPoint{value: Int64Value(10), boundType: BoundTypeClosed}, valueRange.LowerEndPoint(), "the lower EndPoint should be equal to the expected value")
	assert.Equal(t, &EndPoint{value: Int64Value(114), boundType: BoundTypeClosed}, valueRange.UpperEndPoint(), "the upper EndPoint should be equal to the expected value")
	assert.Equal(t, 1, valueRange.Compare(Int64Value(9)), "the ValueRange should be larger than Int64Value(9)")
	assert.Equal(t, 0, valueRange.Compare(Int64Value(10)), "the ValueRange should contain Int64Value(10)")
	assert.Equal(t, 0, valueRange.Compare(Int64Value(50)), "the ValueRange should contain Int64Value(50)")
	assert.Equal(t, 0, valueRange.Compare(Int64Value(114)), "the ValueRange should contain Int64Value(114)")
	assert.Equal(t, -1, valueRange.Compare(Int64Value(115)), "the ValueRange should be smaller Int64Value(115)")
	assert.False(t, valueRange.Contains(Int64Value(9)), "the ValueRange should not contain Int64Value(9)")
	assert.True(t, valueRange.Contains(Int64Value(10)), "the ValueRange should contain Int64Value(10)")
	assert.True(t, valueRange.Contains(Int64Value(50)), "the ValueRange should contain Int64Value(50)")
	assert.True(t, valueRange.Contains(Int64Value(114)), "the ValueRange should contain Int64Value(114)")
	assert.False(t, valueRange.Contains(Int64Value(115)), "the ValueRange should not contain Int64Value(115)")
	valueRangeBytes := valueRange.Bytes()
	restoredValueRange, consumedBytes, err := FromBytes(valueRangeBytes)
	require.NoError(t, err)
	assert.Equal(t, len(valueRangeBytes), consumedBytes, "parsing the ValueRange should consume all available bytes")
	assert.Equal(t, valueRange, restoredValueRange, "the restored ValueRange should be equal to the original one")
}