From 86240375e87482836f5c5877f091df545895f547 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 22 Feb 2022 21:03:24 -0500 Subject: nvdmirror: add failsetcache --- nvdmirror/failsetcache_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 nvdmirror/failsetcache_test.go (limited to 'nvdmirror/failsetcache_test.go') diff --git a/nvdmirror/failsetcache_test.go b/nvdmirror/failsetcache_test.go new file mode 100644 index 0000000..8e20a33 --- /dev/null +++ b/nvdmirror/failsetcache_test.go @@ -0,0 +1,29 @@ +package nvdmirror + +import "testing" + +func TestFailSetCache(t *testing.T) { + var data map[string]string + var cache FailSetCache + + // test get + t.Run("Get", func(t *testing.T) { + if got, ok := cache.Get("foo"); ok { + t.Errorf("got %v, exp !ok", got) + } + }) + + // test set + t.Run("Set", func(t *testing.T) { + if err := cache.Set("bar", data); err == nil { + t.Errorf("got success, exp err") + } + }) + + // test Close + t.Run("Close", func(t *testing.T) { + if err := cache.Close(); err != nil { + t.Error(err) + } + }) +} -- cgit v1.2.3