(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestCacheMemorySyntaxVariations(t *testing.T) { |
| 10 | tests := []struct { |
| 11 | name string |
| 12 | cacheValue any |
| 13 | shouldWork bool |
| 14 | description string |
| 15 | }{ |
| 16 | { |
| 17 | name: "cache-memory with nil (no value)", |
| 18 | cacheValue: nil, |
| 19 | shouldWork: true, |
| 20 | description: "Should enable cache-memory when field is present without value", |
| 21 | }, |
| 22 | { |
| 23 | name: "cache-memory with true", |
| 24 | cacheValue: true, |
| 25 | shouldWork: true, |
| 26 | description: "Should enable cache-memory with boolean true", |
| 27 | }, |
| 28 | { |
| 29 | name: "cache-memory with false", |
| 30 | cacheValue: false, |
| 31 | shouldWork: true, // Still valid, just disabled |
| 32 | description: "Should disable cache-memory with boolean false", |
| 33 | }, |
| 34 | { |
| 35 | name: "cache-memory with object", |
| 36 | cacheValue: map[string]any{ |
| 37 | "key": "custom-key", |
| 38 | }, |
| 39 | shouldWork: true, |
| 40 | description: "Should enable cache-memory with custom configuration", |
| 41 | }, |
| 42 | { |
| 43 | name: "cache-memory with empty object", |
| 44 | cacheValue: map[string]any{}, |
| 45 | shouldWork: true, |
| 46 | description: "Should enable cache-memory with empty object using defaults", |
| 47 | }, |
| 48 | { |
| 49 | name: "cache-memory with array - single cache", |
| 50 | cacheValue: []any{ |
| 51 | map[string]any{ |
| 52 | "id": "default", |
| 53 | "key": "custom-key", |
| 54 | }, |
| 55 | }, |
| 56 | shouldWork: true, |
| 57 | description: "Should enable cache-memory with array notation (single cache)", |
| 58 | }, |
| 59 | { |
| 60 | name: "cache-memory with array - multiple caches", |
| 61 | cacheValue: []any{ |
| 62 | map[string]any{ |
| 63 | "id": "default", |
| 64 | "key": "memory-default", |
| 65 | }, |
| 66 | map[string]any{ |
nothing calls this directly
no test coverage detected