(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestPadding(t *testing.T) { |
| 67 | for i := 0; i < 100000; i++ { |
| 68 | wantBytes := make([]byte, 20) |
| 69 | wantBytes[19] = encoding[0] // 0 |
| 70 | copy(wantBytes[0:13], []byte("c6e52g2mrqcjl")[:]) // c6e52g2mrqcjl44hf170 |
| 71 | for j := 0; j < 6; j++ { |
| 72 | wantBytes[13+j] = encoding[rand.Intn(32)] |
| 73 | } |
| 74 | want := string(wantBytes) |
| 75 | id, _ := FromString(want) |
| 76 | got := id.String() |
| 77 | if got != want { |
| 78 | t.Errorf("String() = %v, want %v %v", got, want, wantBytes) |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func TestNew(t *testing.T) { |
| 84 | // Generate 10 ids |
nothing calls this directly
no test coverage detected
searching dependent graphs…