| 16 | } |
| 17 | |
| 18 | func TestPosV3_String(t *testing.T) { |
| 19 | tests := []struct { |
| 20 | pos litestream.PosV3 |
| 21 | want string |
| 22 | }{ |
| 23 | {litestream.PosV3{}, ""}, |
| 24 | {litestream.PosV3{Generation: "0123456789abcdef", Index: 1, Offset: 4096}, "0123456789abcdef/00000001:0000000000001000"}, |
| 25 | } |
| 26 | for _, tt := range tests { |
| 27 | if got := tt.pos.String(); got != tt.want { |
| 28 | t.Errorf("PosV3%+v.String() = %q, want %q", tt.pos, got, tt.want) |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | func TestSnapshotInfoV3_Pos(t *testing.T) { |
| 34 | info := litestream.SnapshotInfoV3{Generation: "abc", Index: 5} |