aboutsummaryrefslogtreecommitdiff
path: root/nvdmirror/failsetcache_test.go
blob: 8e20a335f0d1061f013e01204d1d67b5fb449e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)
    }
  })
}