File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter_test/flutter_test.dart' ;
2
2
import 'package:json_cache/json_cache.dart' ;
3
+ import 'package:shared_preferences/shared_preferences.dart' ;
3
4
4
5
/// Throws an exception after 'N' refreshes.
5
6
class _JsonCacheThrowsAfterN extends JsonCacheWrap {
@@ -170,6 +171,15 @@ void main() {
170
171
expect (mem[profKey], profData);
171
172
expect (mem[prefKey], prefData);
172
173
});
174
+ test ('value missing from L1 cache' , () async {
175
+ const key = 'aValue' ;
176
+ const value = < String , dynamic > {'must be a json encodable value' : true };
177
+ final prefs = JsonCachePrefs (await SharedPreferences .getInstance ());
178
+ await prefs.refresh (key, value);
179
+ final JsonCacheMem memCache = JsonCacheMem (prefs);
180
+ final cacheL2Value = await memCache.value (key);
181
+ expect (cacheL2Value, value);
182
+ });
173
183
});
174
184
});
175
185
}
You can’t perform that action at this time.
0 commit comments