diff options
Diffstat (limited to 'cache/cache_test.go')
| -rw-r--r-- | cache/cache_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
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) +} |
