d9544b435b
Hop-State: A_06FN3QYA1N56NQYGZ81DWGR Hop-Proposal: R_06FN3QXJRYPPEQZQA6S69QG Hop-Task: T_06FN3MVGY3MT82ESQ89BND0 Hop-Attempt: AT_06FN3MVGY092BFA5MR9C7EG
24 lines
385 B
Go
24 lines
385 B
Go
package ids
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestRepository(t *testing.T) {
|
|
first, err := Repository()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
second, err := Repository()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !strings.HasPrefix(first, "RP_") || len(first) != 29 {
|
|
t.Fatalf("unexpected repository ID %q", first)
|
|
}
|
|
if first == second {
|
|
t.Fatal("generated duplicate IDs")
|
|
}
|
|
}
|