vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
refactor
c5902451905acdaa478f8476844ccd4a510d9ca9 · Keenan Nemetz · 17d ago · parent ec2aba4b
core/id/id_test.go +27
| @@ -0,0 +1,27 @@ | |||
| 1 | package id | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "testing" | ||
| 5 | "time" | ||
| 6 | ) | ||
| 7 | |||
| 8 | func TestULIDAndOrdering(t *testing.T) { | ||
| 9 | t.Parallel() | ||
| 10 | a, err := New(time.Unix(1700000000, 0)) | ||
| 11 | if err != nil { | ||
| 12 | t.Fatal(err) | ||
| 13 | } | ||
| 14 | b, err := New(time.Unix(1700000001, 0)) | ||
| 15 | if err != nil { | ||
| 16 | t.Fatal(err) | ||
| 17 | } | ||
| 18 | if !Valid(a) || !Valid(b) { | ||
| 19 | t.Fatalf("invalid ulids: %q %q", a, b) | ||
| 20 | } | ||
| 21 | if a >= b { | ||
| 22 | t.Fatalf("ulids do not sort by time: %q >= %q", a, b) | ||
| 23 | } | ||
| 24 | if Valid("lowercase0123456789ABCDEFGH") { | ||
| 25 | t.Fatal("lowercase ulid accepted") | ||
| 26 | } | ||
| 27 | } | ||