You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
409 B
31 lines
409 B
package cachem
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNew(t *testing.T) {
|
|
one := New()
|
|
two := New()
|
|
if one == two {
|
|
t.Error("new() same instance")
|
|
}
|
|
}
|
|
|
|
func TestGet(t *testing.T) {
|
|
one := Get()
|
|
two := Get()
|
|
if one != two {
|
|
t.Error("get not single instance")
|
|
}
|
|
three := Get(Option{
|
|
Name: "three",
|
|
})
|
|
four := Get(Option{
|
|
Name: "four",
|
|
})
|
|
if three == four {
|
|
t.Error("get() same instance")
|
|
}
|
|
}
|