mirror of
https://github.com/luxfi/zapdb.git
synced 2026-07-27 06:54:45 +00:00
22 lines
553 B
Go
22 lines
553 B
Go
package badger
|
|
|
|
import (
|
|
"math"
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// Regression test for github.com/dgraph-io/badger/pull/1800
|
|
func TestLargeEncode(t *testing.T) {
|
|
var headerEnc [maxHeaderSize]byte
|
|
h := header{math.MaxUint32, math.MaxUint32, math.MaxUint64, math.MaxUint8, math.MaxUint8}
|
|
require.NotPanics(t, func() { _ = h.Encode(headerEnc[:]) })
|
|
}
|
|
|
|
func TestNumFieldsHeader(t *testing.T) {
|
|
// maxHeaderSize must correspond with any changes made to header
|
|
require.Equal(t, 5, reflect.TypeOf(header{}).NumField())
|
|
}
|