From fbdc2b9d849913ccf8dd7a9001012ce2d28cbd2f Mon Sep 17 00:00:00 2001 From: ewy Date: Thu, 16 Apr 2026 22:48:32 +0200 Subject: when reindexing in --all, only index "added" sources --- cache/cache_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cache/cache_test.go') diff --git a/cache/cache_test.go b/cache/cache_test.go index fa81974..c140154 100644 --- a/cache/cache_test.go +++ b/cache/cache_test.go @@ -77,3 +77,17 @@ func TestFromReader_Comments(t *testing.T) { Label: "da source", }) } + +func TestStrip(t *testing.T) { + c := Cache{Entries: []Entry{{"/asdf/123", ""}, {"xxxxx", "lab"}}} + remove := Cache{Entries: []Entry{{"xxxxx", "wronglabel"}}} + result := c.Strip(remove) + assert.Equal(t, Cache{Entries: []Entry{{"/asdf/123", ""}}}, result) +} + +func TestStrip_Nothing(t *testing.T) { + c := Cache{Entries: []Entry{{"/asdf/123", ""}, {"/asdf/123", ""}}} + old := Cache{} + result := c.Strip(old) + assert.Equal(t, c, result) +} -- cgit v1.3