@@ -37,6 +37,7 @@ function makeThing(n) {
37
37
return {
38
38
vobjID : `t${ n } ` ,
39
39
rawData : `thing #${ n } ` ,
40
+ dirty : true ,
40
41
} ;
41
42
}
42
43
@@ -71,6 +72,7 @@ test('cache overflow and refresh', t => {
71
72
72
73
// lookup that has no effect
73
74
things [ 0 ] = cache . lookup ( 't0' ) ; // cache: t0, t2, t5, t4
75
+ things [ 0 ] . dirty = true ; // pretend we changed it
74
76
t . is ( things [ 0 ] . rawData , 'thing #0' ) ;
75
77
t . is ( things [ 3 ] . rawData , null ) ;
76
78
t . deepEqual ( store . getLog ( ) , [
@@ -100,7 +102,6 @@ test('cache overflow and refresh', t => {
100
102
[ 'store' , 't2' , 'thing #2' ] ,
101
103
[ 'store' , 't0' , 'thing #0' ] ,
102
104
[ 'store' , 't4' , 'thing #4' ] ,
103
- [ 'store' , 't1' , 'thing #1' ] ,
104
105
] ) ;
105
106
t . deepEqual ( store . dump ( ) , [
106
107
[ 't0' , 'thing #0' ] ,
@@ -114,16 +115,22 @@ test('cache overflow and refresh', t => {
114
115
// verify that changes get written
115
116
things [ 0 ] = cache . lookup ( 't0' ) ; // cache: t0
116
117
things [ 0 ] . rawData = 'new thing #0' ;
118
+ things [ 0 ] . dirty = true ;
117
119
things [ 1 ] = cache . lookup ( 't1' ) ; // cache: t1, t0
118
120
things [ 1 ] . rawData = 'new thing #1' ;
121
+ things [ 1 ] . dirty = true ;
119
122
things [ 2 ] = cache . lookup ( 't2' ) ; // cache: t2, t1, t0
120
123
things [ 2 ] . rawData = 'new thing #2' ;
124
+ things [ 2 ] . dirty = true ;
121
125
things [ 3 ] = cache . lookup ( 't3' ) ; // cache: t3, t2, t1, t0
122
126
things [ 3 ] . rawData = 'new thing #3' ;
127
+ things [ 3 ] . dirty = true ;
123
128
things [ 4 ] = cache . lookup ( 't4' ) ; // cache: t4, t3, t2, t1
124
129
things [ 4 ] . rawData = 'new thing #4' ;
130
+ things [ 4 ] . dirty = true ;
125
131
things [ 5 ] = cache . lookup ( 't5' ) ; // cache: t5, t4, t3, t2
126
132
things [ 5 ] . rawData = 'new thing #5' ;
133
+ things [ 5 ] . dirty = true ;
127
134
t . is ( things [ 0 ] . rawData , null ) ;
128
135
t . is ( things [ 5 ] . rawData , 'new thing #5' ) ;
129
136
t . deepEqual ( store . getLog ( ) , [
0 commit comments