@@ -80,6 +80,7 @@ void main() {
80
80
final cachedPref = await initMemCache.value (prefKey);
81
81
expect (cachedPref, isNull);
82
82
});
83
+ <<<<<< < HEAD
83
84
test ('ext ctor' , () async {
84
85
final copy = Map <String , Map <String , dynamic >?>.of (data);
85
86
final JsonCacheMem extMemCache = JsonCacheMem .ext (copy);
@@ -89,6 +90,17 @@ void main() {
89
90
expect (cachedProf, isNull);
90
91
91
92
final cachedPref = await extMemCache.value (prefKey);
93
+ ====== =
94
+ test ('mem ctor' , () async {
95
+ final copy = Map <String , Map <String , dynamic >?>.of (data);
96
+ final JsonCacheMem memCache = JsonCacheMem .mem (copy);
97
+ await memCache.clear ();
98
+
99
+ final cachedProf = await memCache.value (profKey);
100
+ expect (cachedProf, isNull);
101
+
102
+ final cachedPref = await memCache.value (prefKey);
103
+ >>>>>> > 32
92
104
expect (cachedPref, isNull);
93
105
94
106
expect (copy.isEmpty, true );
@@ -110,6 +122,7 @@ void main() {
110
122
final JsonCacheMem initMemCache = JsonCacheMem .init (data);
111
123
await initMemCache.refresh (profKey, profData);
112
124
await initMemCache.refresh (prefKey, prefData);
125
+ <<<<<< < HEAD
113
126
114
127
await initMemCache.remove (profKey);
115
128
final cachedProf = await initMemCache.value (profKey);
@@ -140,6 +153,38 @@ void main() {
140
153
await memCache.refresh (profKey, profData);
141
154
await memCache.refresh (prefKey, prefData);
142
155
156
+ ====== =
157
+
158
+ await initMemCache.remove (profKey);
159
+ final cachedProf = await initMemCache.value (profKey);
160
+ expect (cachedProf, isNull);
161
+
162
+ await initMemCache.remove (prefKey);
163
+ final cachedPref = await initMemCache.value (prefKey);
164
+ expect (cachedPref, isNull);
165
+ });
166
+ test ('mem ctor' , () async {
167
+ final copy = Map <String , Map <String , dynamic >?>.of (data);
168
+ final JsonCacheMem memCache = JsonCacheMem .mem (copy);
169
+ await memCache.refresh (profKey, profData);
170
+ await memCache.refresh (prefKey, prefData);
171
+
172
+ await memCache.remove (profKey);
173
+ final cachedProf = await memCache.value (profKey);
174
+ expect (cachedProf, isNull);
175
+
176
+ await memCache.remove (prefKey);
177
+ final cachedPref = await memCache.value (prefKey);
178
+ expect (cachedPref, isNull);
179
+ });
180
+ });
181
+ group ('refresh and value' , () {
182
+ test ('default ctor' , () async {
183
+ final JsonCacheMem memCache = JsonCacheMem ();
184
+ await memCache.refresh (profKey, profData);
185
+ await memCache.refresh (prefKey, prefData);
186
+
187
+ >>>>>> > 32
143
188
final cachedProf = await memCache.value (profKey);
144
189
expect (cachedProf, profData);
145
190
@@ -157,6 +202,7 @@ void main() {
157
202
final cachedPref = await initMemCache.value (prefKey);
158
203
expect (cachedPref, prefData);
159
204
});
205
+ <<<<<< < HEAD
160
206
test ('ext ctor' , () async {
161
207
final ext = < String , Map <String , dynamic >? > {};
162
208
final JsonCacheMem extMemCache = JsonCacheMem .ext (ext);
@@ -170,6 +216,21 @@ void main() {
170
216
expect (cachedPref, prefData);
171
217
expect (ext[profKey], profData);
172
218
expect (ext[prefKey], prefData);
219
+ ====== =
220
+ test ('mem ctor' , () async {
221
+ final mem = < String , Map <String , dynamic >? > {};
222
+ final JsonCacheMem memCache = JsonCacheMem .mem (mem);
223
+ await memCache.refresh (profKey, profData);
224
+ await memCache.refresh (prefKey, prefData);
225
+
226
+ final cachedProf = await memCache.value (profKey);
227
+ expect (cachedProf, profData);
228
+
229
+ final cachedPref = await memCache.value (prefKey);
230
+ expect (cachedPref, prefData);
231
+ expect (mem[profKey], profData);
232
+ expect (mem[prefKey], prefData);
233
+ >>>>>> > 32
173
234
});
174
235
});
175
236
});
0 commit comments