vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
|
c5902451
Keenan Nemetz
16d ago
|
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 | } |