Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
669 B · 24 lines
Go
12345678910111213141516171819202122232425package 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()) } }}