(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func TestConfig(t *testing.T) { |
| 131 | const maxBytes = 1 << 5 |
| 132 | px, ds := NewProxiedDisk(t) |
| 133 | |
| 134 | ld := test.NewLoader() |
| 135 | ld.SetStorage("origin", ds) |
| 136 | ld.SetStorage("cache", px) |
| 137 | |
| 138 | cache, err := newFromConfig(ld, jsonconfig.Obj{ |
| 139 | "origin": "origin", |
| 140 | "cache": "cache", |
| 141 | "maxCacheBytes": float64(maxBytes), |
| 142 | }) |
| 143 | |
| 144 | if err != nil { |
| 145 | t.Fatal(err) |
| 146 | } |
| 147 | |
| 148 | sto := cache.(*Storage) |
| 149 | if sto.maxCacheBytes != maxBytes { |
| 150 | t.Fatalf("incorrectly read maxCacheBytes. saw: %d expected: %d", |
| 151 | sto.maxCacheBytes, maxBytes) |
| 152 | } |
| 153 | } |
nothing calls this directly
no test coverage detected