package db import ( "testing" "tangled.org/core/knotfeed" ) func TestHostCursorKeepsFeedItWasStoredWith(t *testing.T) { const legacySeq = 1788245839553422000 for _, tt := range []struct { token string want knotfeed.Cursor }{ {knotfeed.FeedLegacy.Token(), knotfeed.NewCursor(knotfeed.FeedLegacy, legacySeq)}, {knotfeed.FeedAtproto.Token(), knotfeed.NewCursor(knotfeed.FeedAtproto, legacySeq)}, {"carrier pigeon", knotfeed.Cursor{}}, } { if got := hostCursor("oyster.cafe", legacySeq, tt.token); got != tt.want { t.Errorf("hostCursor with feed %q = %v/%d, want %v/%d", tt.token, got.Feed(), got.Seq(), tt.want.Feed(), tt.want.Seq()) } } }