mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
Fix failing test
This commit is contained in:
@@ -8,6 +8,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestShortUUID(t *testing.T) {
|
func TestShortUUID(t *testing.T) {
|
||||||
|
a, err := HumanUUID4()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
b, err := HumanUUID4()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if a == b {
|
||||||
|
t.Fatalf("Two short uuid4's are unexpectedly equal")
|
||||||
|
}
|
||||||
if HumanUUID.pad_to_length != 22 {
|
if HumanUUID.pad_to_length != 22 {
|
||||||
t.Fatalf("pad length for human UUID is %d not %d", HumanUUID.pad_to_length, 22)
|
t.Fatalf("pad length for human UUID is %d not %d", HumanUUID.pad_to_length, 22)
|
||||||
}
|
}
|
||||||
@@ -19,8 +30,8 @@ func TestShortUUID(t *testing.T) {
|
|||||||
t.Fatalf("uuid4 %s has unexpected length: %d", u, len(u))
|
t.Fatalf("uuid4 %s has unexpected length: %d", u, len(u))
|
||||||
}
|
}
|
||||||
|
|
||||||
b := big.NewInt(int64(1234567890123456789))
|
bi := big.NewInt(int64(1234567890123456789))
|
||||||
q := num_to_string(b, HumanUUID.alphabet, &HumanUUID.alphabet_len, HumanUUID.pad_to_length)
|
q := num_to_string(bi, HumanUUID.alphabet, &HumanUUID.alphabet_len, HumanUUID.pad_to_length)
|
||||||
const expected = "bzT6LtUjw4422222222222"
|
const expected = "bzT6LtUjw4422222222222"
|
||||||
if q != expected {
|
if q != expected {
|
||||||
t.Fatalf("unexpected short human serialization: %s != %s", q, expected)
|
t.Fatalf("unexpected short human serialization: %s != %s", q, expected)
|
||||||
|
|||||||
Reference in New Issue
Block a user