16 lines
335 B
Go
16 lines
335 B
Go
|
package helper_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"git.cacert.org/cacert-gosigner/pkg/x509/helper"
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestGenerateRandomSerial(t *testing.T) {
|
||
|
rnd, err := helper.GenerateRandomSerial()
|
||
|
assert.NoError(t, err)
|
||
|
assert.LessOrEqual(t, rnd.BitLen(), 160)
|
||
|
assert.GreaterOrEqual(t, rnd.BitLen(), 153)
|
||
|
}
|