mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 21:31:03 +00:00
19 lines
315 B
Go
19 lines
315 B
Go
|
|
package randomid
|
||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"github.com/stretchr/testify/assert"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestGenerateRandomID(t *testing.T) {
|
||
|
|
found1, err := Generate()
|
||
|
|
assert.NoError(t, err)
|
||
|
|
found2, err := Generate()
|
||
|
|
assert.NoError(t, err)
|
||
|
|
|
||
|
|
assert.Len(t, found1, 8)
|
||
|
|
assert.Len(t, found2, 8)
|
||
|
|
assert.NotEqual(t, found1, found2)
|
||
|
|
}
|