mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-15 04:18:03 +00:00
Weekend fun with further optimisations.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package traefikoidc
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestUniversalCacheSimple(t *testing.T) {
|
||||
// Create a simple cache
|
||||
config := UniversalCacheConfig{
|
||||
Type: CacheTypeGeneral,
|
||||
MaxSize: 10,
|
||||
Logger: GetSingletonNoOpLogger(),
|
||||
}
|
||||
|
||||
cache := NewUniversalCache(config)
|
||||
defer cache.Close()
|
||||
|
||||
// Test Set and Get
|
||||
cache.Set("key1", "value1", 1*time.Hour)
|
||||
|
||||
value, exists := cache.Get("key1")
|
||||
if !exists {
|
||||
t.Error("Expected key1 to exist")
|
||||
}
|
||||
if value != "value1" {
|
||||
t.Errorf("Expected value1, got %v", value)
|
||||
}
|
||||
|
||||
t.Log("Universal cache basic test passed")
|
||||
}
|
||||
Reference in New Issue
Block a user